java中的变量赋值问题
public class TestDemo8 {
public static void main(String args[]) {
int x ; // 按照道理来讲,x是int型,没有赋值,结果应该是0
System.out.println(x) ;
} }
//错误解释:所有的变量在使用前一定要为其直接赋值
public class TestDemo8 {
public static void main(String args[]) {
int x ; // 按照道理来讲,x是int型,没有赋值,结果应该是0
System.out.println(x) ;
} }
//错误解释:所有的变量在使用前一定要为其直接赋值