单选题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

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

Given: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

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.

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.

Listening activities can only be conducted with the whole class.()

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

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.

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.

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.

package geometry;  public class Hypotenuse {  public InnerTriangle it = new InnerTriangle();  class InnerTriangle {  public int base;  public int height;  }  }  Which 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.

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.

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

Given: 1.package test; 2. 3.class Target { 4.public String name = "hello";5.} 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 Windows Communication Foundation (WCF) service is generating a separate namespace declaration for each body member of a message contract,even though all body members share the same namespace. You need to simplify the XML representation of your message contract so that the namespace is only declared once. What should you do?()A、Declare a wrapper namespace for the message contract by using the WrapperNamespace property of the MessageContract attributeB、Explicitly set the Namespace property of all the MessageBodyMember attrbutes to the same namespace.C、Declare all of the body members as properties of a DataContract class and use the class as the only body member of the message contract.D、Declare all of the body members as properties of a separate MessageContract class and use the class as the only body member of the message contract.

单选题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.

多选题Given: 3.class MyServlet extends HttpServlet { 4.public void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException,IOException { 5.// servlet code here ... 26.} 27.} If the DD contains a single security constraint associated with MyServlet and its only  tagsand  tags are:GETPUT Admin Which four requests would be allowed by the container?()AA user whose role is Admin can perform a PUT.BA user whose role is Admin can perform a GET.CA user whose role is Admin can perform a POST.DA user whose role is Member can perform a PUT.EA user whose role is Member can perform a POST.FA user whose role is Member can perform a GET.

多选题Which three statements are true?()AA final method in class X can be abstract if and only if X is abstract.BA protected method in class X can be overridden by any subclass of X.CA private static method can be called only within other static methods in class X.DA non-static public final method in class X can be overridden in any subclass of X.EA public static method in class X can be called by a subclass of X without explicitly referencing the class X.FA method with the same signature as a private final method in class X can be implemented in a subclass of X.GA protected method in class X can be overridden by a subclass of X only if the subclass is in the same package as X.

单选题package geometry;  public class Hypotenuse {  public InnerTriangle it = new InnerTriangle();  class InnerTriangle {  public int base;  public int height;  }  }  Which 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.

多选题What elements of globalization can be explicitly defined using the NLS_LANG environment variable?()ANLS_LANGUAGEBNLS_SORTCNLS_CALENDARDNLS_CHARACTERSETENLS_TERRITORY

单选题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.

单选题package test; class Target{ public String name="hello"; } What can directly access and change the value of the variable name?()Aany classBonly the Target classCany class in the test packageDany class that extends Target

单选题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

单选题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.

单选题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