多项选择题
Which two valid declarations of a char?()
A. Char ch = “a”;
B. Char ch = ‘\’ ‘;
C. Char ch = ‘cafe’;
D. Char ch = “cafe”;
E. Char ch = ‘\ucafe’;
F. Char ch = ‘\u10100’;
G. Char ch = (char) true;
相关考题
-
单项选择题
public class foo { static String s; public static void main (String[]args) { system.out.printIn (“s=” + s); } } What is the result?()
A. The code compiles and “s=” is printed.
B. The code compiles and “s=null” is printed.
C. The code does not compile because string s is not initialized.
D. The code does not compile because string s cannot be referenced.
E. The code compiles, but a NullPointerException is thrown when toString is called. -
多项选择题
public interface Foo{ int k = 4; } Which three are equivalent to line 2?()
A. Final int k = 4;
B. Public int k = 4;
C. Static int k = 4;
D. Private int k = 4;
E. Abstract int k = 4;
F. Volatile int k = 4; -
单项选择题
int index = 1; String [] test = new String[3]; String foo = test[index]; What is the result?()
A. Foo has the value “”
B. Foo has the value null
C. An exception is thrown
D. The code will not compile
