public class Foo { static int[] a; static { a[0]=2; } public static void main( String[] args) {} } Which exception or error will be thrown when a programmer attempts to run this code?()
相似题目
-
public class foo { public static void main (string[]args) try {return;} finally {system.out.printIn(“Finally”);} } What is the result?()
-
1.public class Test { 2.public static void main (String args[]) { 3.class Foo { 4.public int i = 3; 5.} 6.Object o = (Object) new Foo(); 7.Foo foo = (Foo)o; 8.System.out.printIn(foo. i); 9. } 10.} What is the result?()
-
public class foo { public static void main (stringargs) try {return;} finally {system.out.printIn(“Finally”);} } What is the result?()
-
public class Test { public static void main (String args) { string foo = “blue”; string bar = foo; foo = “green”; System.out.printIn(bar); } } What is the result?()
-
public class Delta { static boolean foo(char c) { System.out.print(c); return true; } public static void main( String[] argv ) { int i =0; for ( foo(‘A’); foo(‘B’)&&(i<2); foo(‘C’)){ i++ ; foo(‘D’); } } } What is the result?()
-
package foo; public class Outer { public static class Inner { } } Which statement is true?()
-
package foo; public class Outer ( public static class Inner ( ) ) Which statement is true?()
-
2. public class Foo implements Runnable ( 3. public void run (Thread t) { 4. system.out.printIn(“Running.”); 5. } 6. public static void main (String[] args) { 7. new thread (new Foo()).start(); 8. ) 9. ) What is the result?()
-
public class foo { public static void main (Stringargs) { String s; system.out.printIn (“s=” + s); } } What is the result?()
-
interface foo { int k = 0; } public class test implements Foo ( public static void main(String args) ( int i; Test test = new test (); i= test.k; i= Test.k; i= Foo.k; ) ) What is the result? ()
-
public class test( public static void main(stringargs){ string foo = args [1]; string foo = args ; string foo = args ; } ) And command line invocation: Java Test red green blue What is the result? ()
-
public class Foo implements Runnable ( public void run (Thread t) { system.out.printIn(“Running.”); } public static void main (String args) { new thread (new Foo()).start(); } ) What is the result?()
-
public class Foo implements Runnable ( public void run (Thread t) { system.out.printIn(“Running.”); } public static void main (String[] args) { new thread (new Foo()).start(); } ) What is the result?()
-
public class Test { public static void main (String [] args) { string foo = “blue”; string bar = foo; foo = “green”; System.out.printIn(bar); } } What is the result?()
-
public class Foo implements Runnable ( public void run (Thread t) { system.out.printIn(“Running.”); } public static void main (String args) { new thread (new Foo()).start(); } ) What is the result?()
-
public class test( public static void main(string[]args){ string foo = args [1]; string foo = args [2]; string foo = args [3]; } ) And command line invocation: Java Test red green blue What is the result?()
-
public class Foo { public static void main(String[] args) { try { return; } finally { System.out.println( “Finally” ); } } } What is the result?()
-
public class Test { public static void main (String args) { class Foo { public int i = 3; } Object o = (Object) new Foo(); Foo foo = (Foo)o; System.out.printIn(foo. i); } } What is the result?()
-
读代码:public class Test {public static void main (String args[]) {class Foo {public int i = 3;}Object o = (Object) new Foo();Foo foo = (Foo)o;System.out.println(foo.i);}}结果是:
-
读代码:public class foo {static String s;public static void main (String[]args) {System.out.println (“s=” + s);}}结果是:
-
读代码:public class Test {public static void main (String [] args) {String foo = “blue”;String bar = foo;foo = “green”;System.out.println(bar);}}结果是:
-
下列程序运行后的输出结果是_public class Foo{ public static void main(String[] args){ String s; System.out.println(“s=” + s); }}()
-
下面的程序段执行结果是 public class Foo { public static void main(String[] args) { try{ return; }finally { System.out.println("finally"); } } }
-
10、以下程序代码运行时输出的结果是()。public class Foo{ public static void main(String[] args){ try{ System.out.print('A'); foo1(); System.out.print('B'); }catch(RuntimeException e){ System.out.print('C'); }catch(Exception e){ System.out.println('D'); } } public static void foo1() throws RuntimeException{ throw new RuntimeException(); } }
推荐题目
- 在投标或接受合同之前,公司要求对标书、合同或协议进行评审,评审的内容除各项要求是否合理、明确并形成文件,本公司是否具有满足合同要求的能力,合同项目是否具有经济可行性外,还包括下面()的内容。
- 辅助面积
- 主要经呼吸道进入人体,具有腐蛋臭味的物质().
- 男性,50岁。1年前因慢性腹泻在某医院做乙状结肠镜检,诊断为慢性血吸虫病,此次因不规则发热40天伴纳差、腹胀住院。体检:肝肋下1cm,剑下4cm,质中,脾肋下2cm。化验:WBC4.2×109/L,N0.68(68%),L0.30(30%),E0.02(2%),肥达反应“O”1:160,“H”1:320,“A”1:80,“B”1:40最可能诊断是()
- 间歇热
- 油包水乳化钻井液的滤失量低,滤液主要是油而不是水。
- 铣削时,可以利用三爪夹头夹持圆形工件。()
- 女性,32岁,月经增多伴发热2周,HGB50g/L.WBC1.2×109/L,PLT20×109/L,网织红细胞0.3%,初次髂骨穿刺骨髓检查提示:骨髓象成熟红细胞与有核细胞比例100:1为确诊患者还必须作的检查是()
- Now that spring is here, you can _____ these fur coats till you need them again next winter.
- 某企业从设备租赁公司租借一台设备,该设备的价格为60万元,租期为6年,折现率为12%。若按年金法计算,则该企业每年年末等额支付和每年年初等额支付的租金分别为()万元