单项选择题
A class design requires that a member variable cannot be accessible directly outside the class. Which modifier should be used to obtain the access control?()
A. public
B. no modifier
C. protected
D. private
点击查看答案&解析
相关考题
-
多项选择题
Whichofthefollowingstatementsaboutvariablesandscopearetrue?()
A. Local variables defined inside a method are destroyed when the method is exited.
B. Local variables are also called automatic variables.
C. Variables defined outside a method are created when the object is constructed.
D. A method parameter variable continues to exist for as long as the object is needed in which the method is defined. -
单项选择题
Given the following code: 1) public void modify() { 2) int i, j, k; 3) i = 100; 4) while ( i > 0 ) { 5) j = i * 2; 6) System.out.println (" The value of j is " + j ); 7) k = k + 1; 8) i--; 9) } 10) } Which line might cause an error during compilation?()
A. line 4
B. line 6
C. line 7
D. line 8 -
多项选择题
IntheJavaAPIdocumentationwhichsectionsareincludedinaclassdocument?()
A. The description of the class and its purpose
B. A list of methods in its super class
C. A list of member variable
D. The class hierarchy
