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

Instance access through types not allowed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.2.0
    • 1.1.2, 1.1.3
    • tools
    • None
    • 1.2beta2
    • generic, x86, sparc
    • solaris_2.5, solaris_2.5.1, windows_95
    • Not verified

      javac allows instance access through types (like C++), but the JLS explicitly
      disallows this. This is one of the many ways Java is better than C++ and it
      will be great if javac can also be simplified likewise.

      Example:

      class C {

        int x;

        int y = C.x;

      }

      The reference to x as C.x is illegal, but javac allows it.

            dstoutamsunw David Stoutamire (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: