6.6.2 Details on protected Access
A protected member or constructor of an object may be accessed from outside
the package in which it is declared only by code that is responsible for the implementation
of that object.
6.6.2.1 Access to a protected Member
Let C be the class in which a protected member m is declared. Access is permitted
only within the body of a subclass S of C. In addition, if Id denotes an
instance field or instance method, then:
• If the access is by a qualified name Q.Id, where Q is an ExpressionName,
then the access is permitted if and only if the type of the expression Q is S or a
subclass of S.
• If the access is by a field access expression E.Id, where E is a Primary
expression, or by a method invocation expression E.Id(. . .), where E is a
Primary expression, then the access is permitted if and only if the type of E is
S or a subclass of S.
6.6.2.2 Qualified Access to a protected Constructor
Let C be the class in which a protected constructor is declared and let S be the
innermost class in whose declaration the use of the protected constructor
occurs. Then:
• If the access is by a superclass constructor invocation super(. . .) or by a
qualified superclass constructor invocation of the form E.super(. . .), where
E is a Primary expression, then the access is permitted.
• If the access is by an anonymous class instance creation expression of the
form new C(. . .){...} or by a qualified class instance creation expression of
the form E.new C(. . .){...}, where E is a Primary expression, then the
access is permitted.
• Otherwise, if the access is by a simple class instance creation expression of
the form new C(. . .) or by a qualified class instance creation expression of the
form E.new C(. . .), where E is a Primary expression, then the access is not
permitted. A protected constructor can be accessed by a class instance creation
expression (that does not declare an anonymous class) only from within
the package in which it is defined.一行2分
只要翻译的正确都给分

解决方案 »

  1.   

    6.6.2 Details on protected Access 
    保护访问细节
    6.6.2.1 Access to a protected Member 
    访问protected成员
    the package in which it is defined.
    在被定义的包(内)(送一个within)
    不用谢,记得给我6分
      

  2.   

    最后一段:
    否则,如果访问是由一个简单的类实例创建的表达
    形式新的 C(),
    或由合格的类的实例的创建表达式形式 E.new℃(),其中E是主表达式,然后访问是不
    允许的。受保护的构造函数可以访问一个类的实例创建
    表达式(不申报匿名类),而且只从内部
    来定义它的包。
      

  3.   

    A protected member or constructor of an object may be accessed from outside 
    the package in which it is declared only by code that is responsible for the implementation 
    of that object:
    一个对象如果想访问另一个对象里面的受保护的变量或者受保护构造器的时候,只能够通过继承这个对象。
      

  4.   

    6.6.2 Details on protected Access 
     保护访问细节 
      A protected member or constructor of an object may be accessed from outside 
    the package in which it is declared only by code that is responsible for the implementation 
    of that object:
      一个对象如果想访问另一个对象里面的受保护的变量或者受保护构造器的时候,只能够通过继承这个对象。
    6.6.2.1 Access to a protected Member 
      访问protected成员 
    6.6.2.2 Qualified Access to a protected Constructor 
    受限访问受保护的构造器