单选题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
单选题
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
private
B
no modifier
C
public
D
protected
参考解析
解析:
一个类中定义的成员变量只能被同一包中的类访问。
相关考题:
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
Amembervariabledefinedinaclasscanbeaccessedonlybytheclassesinthesamepackage.Whichmodifiershouldbeusedtoobtaintheaccesscontrol?() A.privateB.nomodifierC.publicD.protected
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 keyword can protect a class in a package from accessibility by the classes outside the package()。A、privateB、protectedC、finalD、don’t use any keyword at all (make it default)
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.
Which two statements are true of login classes?()A、Users can be members of multiple login classes.B、Login classes define authorization parameters for a user.C、There are five system-defined login classes.D、Login class permission flags can be overridden for certain commands.
What does it mean for a variable in the Application Editor to be defined as a parameter?()A、The variable can be used to pass data to and from subflows. B、The value for that variable can be supplied via Application Configuration in Application Administration. C、The value for that variable is defined by the calling application. D、The variable can be used in conditional steps. E、The variable can be used to pass data to and from VoiceXML applications.
You want a class to have access to members of another class in the same package. Which is the most restrictive access that accomplishes this objective?() A、 publicB、 privateC、 protectedD、 transientE、 default access
You want a class to have access to members of another class in the same package. Which is the most restrictive access modifier that will accomplish that will accomplish this objective?() A、 PublicB、 PrivateC、 ProtectedD、 TransientE、 No access modifier is required.
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.
Which two demonstrate encapsulation of data?() A、 Member data have no access modifiers.B、 Member data can be modified directly.C、 The access modifier for methods is protected.D、 The access modifier to member data is private.E、 Methods provide for access and modification of data.
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、 PublicB、 PrivateC、 ProtectedD、 TransientE、 No access modifier is required
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 two statements are true about firewall filter configurations?()A、Multiple action modifiers can be included in the same term.B、Only a single action modifier can be included in the same term.C、If an action modifier exists without a terminating action, matching packets will be accepted.D、If an action modifier exists without a terminating action, matching packets will be discarded.
Which three statements are true?()A、A final method in class X can be abstract if and only if X is abstract.B、A protected method in class X can be overridden by any subclass of X.C、A private static method can be called only within other static methods in class X.D、A non-static public final method in class X can be overridden in any subclass of X.E、A public static method in class X can be called by a subclass of X without explicitly referencing the class X.F、A method with the same signature as a private final method in class X can be implemented in a subclass of X.G、A protected method in class X can be overridden by a subclass of X only if the subclass is in the same package as X.
单选题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
单选题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?()AMark the method with the keyword public.BMark the method with the keyword protected.CMark the method with the keyword private.DMark the method with the keyword package.EDo not mark the method with any accessibility modifiers.
单选题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 PublicB PrivateC ProtectedD TransientE No access modifier is required
多选题Which statements concerning the correlation between the inner and outer instances of non-static inner classes are true?()AMember variables of the outer instance are always accessible to inner instances, regardless of their accessibility modifiers.BMember variables of the outer instance can never be referred to using only the variable name within the inner instance.CMore than one inner instance can be associated with the same outer instance.DAll variables from the outer instance that should be accessible in the inner instance must be declared final.EA class that is declared final cannot have any inner classes.
单选题Which statement about firefighting foam is TRUE?()AFoam conducts electricityBTo be most effective,foam should be directed at the base of the fireCFoam is most effective on burning liquids which are flowingDFoam can ONLY be used to extinguish class A fires
多选题Which two demonstrate encapsulation of data? ()AMember data have no access modifiers.BMember data can be modified directly.CThe access modifier for methods is protected.DThe access modifier to member data is private.EMethods provide for access and modification of data.
单选题What does it mean for a variable in the Application Editor to be defined as a parameter?()AThe variable can be used to pass data to and from subflows. BThe value for that variable can be supplied via Application Configuration in Application Administration. CThe value for that variable is defined by the calling application. DThe variable can be used in conditional steps. EThe variable can be used to pass data to and from VoiceXML applications.
单选题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.
单选题You want a class to have access to members of another class in the same package. Which is the most restrictive access that accomplishes this objective?()A publicB privateC protectedD transientE default access
单选题You want a class to have access to members of another class in the same package. Which is the most restrictive access modifier that will accomplish that will accomplish this objective?()A PublicB PrivateC ProtectedD TransientE No access modifier is required.