多项选择题
The 8859-1 character code for the uppercase letter A is 65. Which of these code fragments declare and initialize a variable of type char with this value?()
A.char ch = 65;
B.char ch = ’¥65’;
C.char ch = ’¥0041’;
D.char ch = ’A’;
E.char ch = "A";
相关考题
-
多项选择题
Given the following code, which method declarations, when inserted at the indicated position, will not cause the program to fail compilation?() public class Qdd1f { public long sum(long a, long b) { return a + b; } // insert new method declaration here }
A.public int sum(int a, int b) { return a + b; }
B.public int sum(long a, long b) { return 0; }
C.abstract int sum();
D.private long sum(long a, long b) { return a + b; }
E.public long sum(long a, int b) { return a + b; } -
多项选择题
Whichstatementsconcerningcastingandconversionaretrue?()
A.Conversion from int to long does not need a cast.
B.Conversion from byte to short does not need a cast.
C.Conversion from float to long does not need a cast.
D.Conversion from short to char does not need a cast.
E.Conversion from boolean to int using a cast is not possible. -
多项选择题
Given the following code, which statements concerning the objects referenced through the member variables i, j and k are true, given that any thread may call the methods a, b and c at any time? () class Counter { int v = 0; synchronized void inc() { v++; } synchronized void dec() { v--; } } public class Q7ed5 { Counter i; Counter j; Counter k; public synchronized void a() { i.inc(); System.out.println("a"); i.dec(); } public synchronized void b() { i.inc(); j.inc(); k.inc(); System.out.println("b"); i.dec(); j.dec(); k.dec(); } public void c() { k.inc(); System.out.println("c"); k.dec(); } }
A.i.v is guaranteed always to be 0 or 1.
B.j.v is guaranteed always to be 0 or 1.
C.k.v is guaranteed always to be 0 or 1
D.j.v will always be greater than or equal to k.v at any give time.
E.k.v will always be greater than or equal to j.v at any give time.
