下面的程序中,哪行会报错? public class StaticTest { ....showTotalFee(); } }
下面的程序中,哪行会报错? public class StaticTest { ....showTotalFee(); } }
下面的程序中,哪行会报错? public class StaticTest { int age; String name; static int totalFee = 500; public void showName() { System.out.print(this.name); } public static void showTotalFee() { line 1: System.out.print(totalFee); line 2: showName(); } public static void main(String[] args) { line3: StaticTest.showTotalFee(); } }
下面的程序中,哪行会报错? public class StaticTest { int age; String name; static int totalFee = 500; public void showName() { System.out.print(this.name); } public static void showTotalFee() { line 1: System.out.print(totalFee); line 2: showName(); } public static void main(String[] args) { line3: StaticTest.showTotalFee(); } }
下面的程序中,哪行会报错? publicclassStaticTest{ intage; Stringname; staticinttotalFee=500; publicvoidshowName(){ System.out.print(this.name); } publicstaticvoidshowTotalFee(){ line1:System.out.print(totalFee); line2:showName(); } publicstaticvoidmain(String[]args){ line3:StaticTest.showTotalFee(); } }
下面的程序中,哪行会报错? publicclassStaticTest{ intage; Stringname; staticinttotalFee=500; publicvoidshowName(){ System.out.print(this.name); } publicstaticvoidshowTotalFee(){ line1:System.out.print(totalFee); line2:showName(); } publicstaticvoidmain(String[]args){ line3:StaticTest.showTotalFee(); } }
1