单项选择题
public class Foo {
public void main (String [] args) {
system.out.printIn(“Hello World.”);
}
}
What is the result?()
A. An exception is thrown.
B. The code does no compile.
C. “Hello World.” Is printed to the terminal.
D. The program exits without printing anything.
相关考题
-
单项选择题
1. public class Test { 2. public static void main (String []args) { 3. unsigned byte b = 0; 4. b--; 5. 6. } 7. } What is the value of b at line 5?()
A. -1
B. 255
C. 127
D. Compilation will fail.
E. Compilation will succeed but the program will throw an exception at line 4. -
单项选择题
public class Test { public static void replaceJ(string text) { text.replace (‘j’, ‘l’); } public static void main(String args[]) { string text = new String (“java”) replaceJ(text); system.out.printIn(text); } } What is the result?()
A. The program prints “lava”
B. The program prints “java”
C. An error at line 7 causes compilation to fail.
D. Compilation succeeds but the program throws an exception. -
多项选择题
public class Foo { private int val; public foo(int v) (val = v;) } public static void main (String [] args) { Foo a = new Foo (10); Foo b = new Foo (10); Foo c = a; int d = 10; double e = 10.0; } Which three logical expression evaluate to true?()
A. (a ==c)
B. (d ==e)
C. (b ==d)
D. (a ==b)
E. (b ==c)
F. (d ==10.0)
