Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4035182

Innerclass access to enclosing class private member inconsistency

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.2.0
    • 1.1
    • tools
    • None
    • 1.2beta
    • x86
    • windows_nt
    • Not verified



      Name: mc57594 Date: 02/27/97


      An innerclass can access the private data member of its enclosing
      class implicitly,

      class enclosing {
        class inner {
           { style = 1; }
        }
        private int style;
      }

      is OK, but the following equivalent code causes a compiler error:

      class enclosing {
        class inner {
           { enclosing.this.style = 1; }
        }
        private int style;
      }
      company - Bellcore , email - ###@###.###
      ======================================================================

            wmaddoxsunw William Maddox (Inactive)
            mchamnessunw Mark Chamness (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: