• 2022-06-18
    阅读下面的程序,分析代码是否能够编译通过,答案填“通过”或“不通过”class A { private int secret = 5;}public class Test1 { public static void main(String[] args) { A a = new A____; System.out.println(a.secret++); 学生答案:
  • 不通过 批语:

    内容

    • 0

      阅读下面的程序,分析代码是否能够编译通过,答案填“通过”或“不通过”public class Test01 { public static void main(String[] args) { byte b = 3; b = b + 4; System.out.println("b=" + b); }}

    • 1

      阅读下面的程序,分析代码是否能够编译通过,答案填“通过”或“不通过” public class Test04 { public static void main(String args[]) { int n = 9; while (n > 6) { System.out.println(n); n--; } } }

    • 2

      阅读下面的程序,分析代码是否能编译通过,如果能编译通过,选正确。如果不能编译通过,选错误。 public class A extends Thread{ protected void run() { System.out.println("thisisrun()"); } public static void main(String[] args) { A a = new A(); a.start(); } }

    • 3

      阅读下面的程序,分析代码是否能编译通过。如果能编译通过,请列出运行的结果;如果不能编译通过,请说明原因。class RunHandler {public void run() {System.out.println("run");}}public class Read01 {public static void main(String [] args) {Thread t = new Thread(new RunHandler( ));t.start( );}}

    • 4

      分析程序,将代码补充完整public class Test { ________ __ int k=5; public static void main(String[] args){ Test t1=new Test(); t1.k++; System.out.println(Test.k); }}