為什么報錯說mykito未被賦值
package practice;
public class Test { public static void main(String[] args){
Test tom=new Test();
? int mykito=tom.kito();
?}
public int kito(){ return 0; }
}
為什么報錯說mykito未被賦值 報錯:the value of the local variable mykito is not used
package practice;
public class Test { public static void main(String[] args){
Test tom=new Test();
? int mykito=tom.kito();
?}
public int kito(){ return 0; }
}
為什么報錯說mykito未被賦值 報錯:the value of the local variable mykito is not used
2015-10-19
舉報
2015-10-19
是未使用 不是未賦值 ?這不是報錯 是提醒你定義的變量 但是沒被使用過 ?浪費資源
2015-10-19
JAVA中不能定義之后不被調用的屬性和方法嗎