What is the numerical range of a char?()
A、 0 ... 32767
B、 0 ... 65535
C、 –256 ... 255
D、 –32768 ... 32767
E、 Range is platform dependent.
相关问题推荐
-
A Button is positioned in a Frame. Only height of the Button is affected by the Frame while the width is not. Which layout manager should be used?()
A、 FlowLayout
B、 CardLayout
C、 North and South of BorderLayout
D、 East and West of BorderLayout
E、 GridLayout
-
public class Test { public static void main(String [] args) { int x =5; boolean b1 = true; boolean b2 = false; if((x==4) && !b2) System.out.print(”l “); System.out.print(”2 “); if ((b2 = true) && b1) System.out.print(”3 “); } } What is the result?()
A、 2
B、 3
C、 1 2
D、 2 3
E、 1 2 3
F、 Compilation fails.
G、 Au exceptional is thrown at runtime.
-
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(“i = “ + foo.i); } } What is the result?()
A、 i = 3
B、 Compilation fails.
C、 A ClassCastException is thrown at line 6.
D、 A ClassCastException is thrown at line 7.
-
ClassOne.java 1. package com.abc.pkg1; 2. public class ClassOne { 3. private char var = ‘a’; 4. char getVar() {return var;} 5. } ClassTest.java 1. package com.abc.pkg2; 2. import com.abc.pkg1.ClassOne; 3. public class ClassTest extends ClassOne { 4. public static void main(String[]args) { 5. char a = new ClassOne().getVar(); 6. char b = new ClassTest().getVar(); 7. } 8. } What is the result?()
A、 Compilation will fail.
B、 Compilation succeeds and no exceptions are thrown.
C、 Compilation succeeds but an exception is thrown at line 5 in ClassTest.java.
D、 Compilation succeeds but an exception is thrown at line 6 in ClassTest.java.
-
Which statements concerning the methods notify() and notifyAll() are true?
AInstances of class Thread have a method called notify().
BA call to the method notify() will wake the thread that currently owns the monitor of the object.
CThe method notify() is synchronized.
DThe method notifyAll() is defined in class Thread.
EWhen there is more than one thread waiting to obtain the monitor of an object, there is no way to be sure which thread will be notified by the notify() method.