网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
单选题
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


参考答案

参考解析
解析: 这个在前面也有叙述,java有四种访问类型,分别为:public,protected,default,private,其中public变量可以被所有的外部类访问,而pretected的可以被同一个包及该类的子类访问,default即没有任何修饰符的变量可以被同一个包中的类访问,而private变量只能在被该类内部被访问。题目中的外部类应该理解为除该类自身的所有其它类,因此只有使用private可以达到要求 
更多 “单选题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  publicB  no modifierC  protectedD  private” 相关考题
考题 A class design requires that a member variable should be accessible only by same package, which modifer word should be used? A.protectedB.publicC.no modiferD.private

考题 Which modifer should be applied to a declaration of a class member variable for the value of variable to remain constant after the creation of the object?() A.staticB.finalC.constD.abstract

考题 通过改变参数“接入控制等级(ACC_CONTR_CLASS)”,可限制一些等级的用户接入,减轻网络负荷。“ACC_CONTR_CLASS”越大,其优先级越高。 A.错误B.正确

考题 You are creating a class that performs complex financial calculations.The class contains a method named GetCurrentRate that retrieves the current interest rate and a variable named currRate that stores the current interest rate.You write serialized representations of the class.You need to write a code segment that updates the currRate variable with the current interest ratewhen an instance of the class is deserialized.Which code segment should you use?()A.B.C.D.

考题 A team of programmers is involved in reviewing a proposed design for a new utility class. After some discussion, they realize that the current design allows other classes to access methods in the utility class that should be accessible only to methods within the utility class itself.What design issue has the team discovered?()A.Tight couplingB.Low cohesionC.High cohesionD.Loose couplingE.Weak encapsulationF.Strong encapsulation

考题 Given:Which statement is true about the class of an object that can reference the variable base? () A.It can be any class.B.No class has access to base.C.The class must belong to the geometry package.D.The class must be a subclass of the class Hypotenuse.

考题 The company requires that every staff member ___________ able to use a computer.A.is B.will be C.would be D.be

考题 Which statements concerning the correlation between the inner and outer instances of non-static inner classes are true?()  A、Member variables of the outer instance are always accessible to inner instances, regardless of their accessibility modifiers.B、Member variables of the outer instance can never be referred to using only the variable name within  the inner instance.C、More than one inner instance can be associated with the same outer instance.D、All variables from the outer instance that should be accessible in the inner instance must be declared  final.E、A class that is declared final cannot have any inner classes.

考题 Which statement about static inner classes is true?()A、 An anonymous class can be declared as static.B、 A static inner class cannot be a static member of the outer class.C、 A static inner class does not require an instance of the enclosing class.D、 Instance members of a static inner class can be referenced using the class name of the static inner class.

考题 Which statements concerning the value of a member variable are true, when no explicit assignments have been made?()  A、The value of an int is undetermined.B、The value of all numeric types is zero.C、The compiler may issue an error if the variable is used before it is initialized.D、The value of a String variable is "" (empty string).E、The value of all object variables is null.

考题 A member variable defined in a class can be accessed only by the classes in the same package. Which modifier should be used to obtain the access control?()         A、 privateB、 no modifierC、 publicD、 protected

考题 Which thefollowingstatements about static inner classes is true?()A、 An anonymous class can be declared as static.B、 A static inner class cannot be a static member of the outer class.C、 A static inner class does not require an instance of the enclosing class.D、 Instance member of a static inner class can be referenced using the class name of the staticinner class.

考题 通过改变参数“接入控制等级(ACC_CONTR_CLASS)”,可限制一些等级的用户接入,减轻网络负荷。“ACC_CONTR_CLASS”越大,其优先级越高。

考题 In the CRS Application Editor, where do you start the debugger? ()A、toolbar  B、Step palette  C、Design window  D、Variable window

考题 Which statements about static inner classes are true?()A、 A static inner class requires a static initializer.B、 A static inner class requires an instance of the enclosing class.C、 A static inner class has no reference to an instance of the enclosing class.D、 A static inner class has access to the non-static members of the outer class.E、 Static members of a static inner class can be referenced using the class name of the static inner  class.

考题 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、 publicB、 no modifierC、 protectedD、 private

考题 In the Java API documentation which sections are included in a class document?()    A、 The description of the class and its purposeB、 A list of methods in its super classC、 A list of member variableD、 The class hierarchy

考题 A team of programmers is involved in reviewing a proposed design for a new utility class. After some discussion, they realize that the current design allows other classes to access methods in the utility class that should be accessible only to methods within the utility class itself. What design issue has the team discovered?()A、Tight couplingB、Low cohesionC、High cohesionD、Loose couplingE、Weak encapsulationF、Strong encapsulation

考题 判断题通过改变参数“接入控制等级(ACC_CONTR_CLASS)”,可限制一些等级的用户接入,减轻网络负荷。“ACC_CONTR_CLASS”越大,其优先级越高。A 对B 错

考题 单选题A member variable defined in a class can be accessed only by the classes in the same package. Which modifier should be used to obtain the access control?()A  privateB  no modifierC  publicD  protected

考题 单选题Which thefollowingstatements about static inner classes is true?()A  An anonymous class can be declared as static.B  A static inner class cannot be a static member of the outer class.C  A static inner class does not require an instance of the enclosing class.D  Instance member of a static inner class can be referenced using the class name of the staticinner class.

考题 单选题A team of programmers is involved in reviewing a proposed design for a new utility class. After some discussion, they realize that the current design allows other classes to access methods in the utility class that should be accessible only to methods within the utility class itself. What design issue has the team discovered?()A Tight couplingB Low cohesionC High cohesionD Loose couplingE Weak encapsulation

考题 单选题package test; class Target{ public String name="hello"; } What can directly access and change the value of the variable name?()A any classB only the Target classC any class in the test packageD any class that extends Target

考题 单选题A team of programmers is involved in reviewing a proposed design for a new utility class. After some discussion, they realize that the current design allows other classes to access methods in the utility class that should be accessible only to methods within the utility class itself. What design issue has the team discovered?()A Tight couplingB Low cohesionC High cohesionD Loose couplingE Weak encapsulationF Strong encapsulation

考题 单选题Which of the following commands cannot use the functionality assosciated with theNLS_DATE_FORMAT variable?()A RESTOREB RECOVERC REPORTD BACKUP

考题 单选题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  publicB  no modifierC  protectedD  private

考题 多选题Which statements about static inner classes are true?()AA static inner class requires a static initializer.BA static inner class requires an instance of the enclosing class.CA static inner class has no reference to an instance of the enclosing class.DA static inner class has access to the non-static members of the outer class.EStatic members of a static inner class can be referenced using the class name of the static inner  class.

考题 单选题Which statement about static inner classes is true? ()A  An anonymous class can be declared as static.B  A static inner class cannot be a static member of the outer class.C  A static inner class does not require an instance of the enclosing class.D  Instance members of a static inner class can be referenced using the class name of the static inner class.