class test_1{
test_1(){
System.out.println("jijiji");
}
System.out.println("jijiji");
}
public class Main {
public static void main(String[] args) {
test_1 test = new test_1();
}
}
在test_1类中 在构造函数test_1()中的打印语句没有报错,但是他的下一行却报错了显示需要标识符.请问这是一个什么为什么呢? Java的System.out.println()一定要在method中使用吗?
添加回答
举报
0/150
提交
取消
