You want to limit access to a method of a public class to members of the same class. Which access modifier accomplishes this objective?()
A、 Public
B、 Private
C、 Protected
D、 Transient
E、 No access modifier is required
相关问题推荐
-
Which statement is true?()
A、 This code can throw an InterruptedException.
B、 This code can throw an IllegalMonitorStateException.
C、 This code can throw a TimeoutException after ten minutes.
D、 Reversing the order of obj.wait() and obj.notify() might cause this method to complete normally.
E、 A call to notify() or notifyAll() from another thread might cause this method to complete normally.
F、 This code does NOT compile unless "obj.wait()" is replaced with "((Thread) obj).wait()".
-
What is the result?()
A、 X, followed by an Exception.
B、 No output, and an Exception is thrown.
C、 Compilation fails due to an error on line 14.
D、 Compilation fails due to an error on line 16.
E、 Compilation fails due to an error on line 17.
F、 X, followed by an Exception, followed by B
-
An instance member()
A、is also called a static member
B、is always a variable
C、is never a method
D、belongs to a single instance, not to the class as a whole
E、always represents an operation
-
Which two CANNOT directly cause a thread to stop executing?()
ACalling the yield method.
BCalling the wait method on an object.
CCalling the notify method on an object.
DCalling the notifyAll method on an object.
ECalling the start method on another Thread object.
-
public class test ( private static int j = 0; private static boolean methodB(int k) ( j += k; return true; ) public static void methodA(int i) { boolean b: b = i
A、 The program prints “0”
B、 The program prints “4”
C、 The program prints “8”
D、 The program prints “12”
E、 The code does not complete.