单项选择题
It is desirable that a certain method within a certain class can only be accessed by classes that are defined within the same package as the class of the method. How can such restrictions be enforced?()
A.Mark the method with the keyword public.
B.Mark the method with the keyword protected.
C.Mark the method with the keyword private.
D.Mark the method with the keyword package.
E.Do not mark the method with any accessibility modifiers.
点击查看答案&解析
相关考题
-
多项选择题
WhichofthesearekeywordsinJava?()
A.default
B.NULL
C.String
D.throws
E.long -
单项选择题
Which statements, when inserted at the indicated position in the following code, will cause a runtime exception when attempting to run the program?() class A {} class B extends A {} class C extends A {} public class Q3ae4 { public static void main(String args[]) { A x = new A(); B y = new B(); C z = new C(); // insert statement here } }
A.x = y;
B.z = x;
C.y = (B) x;
D.z = (C) y;
E.y = (A) y; -
单项选择题
WhichmethodsfromtheStringandStringBufferclassesmodifytheobjectonwhichtheyarecalled?()
A.The charAt() method of the String class.
B.The toUpperCase() method of the String class.
C.The replace() method of the String class.
D.The reverse() method of the StringBuffer class.
E.The length() method of the StringBuffer class.
