任何人都可以解释我,
public class Class10 {
public String i=" ";
public String j;
j=" "; //Does-Not work
public void method(String[] args){
public String k=" "; // Does-not work
j=" ";
}
}
答案 0 :(得分:4)
1)可以使用正确的语法(但不鼓励):
public class Class10 {
public String i=" ";
public String j;
{j=" ";} //This is called an "Instance initialization block"
//It would be better to do it in a constructor.
2)没有意义: