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

Javac accepts interface fields without variable initializer

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.3.0
    • 1.3.0
    • tools
    • kestrel
    • generic
    • generic

      The 1.3 compiler accepts the following program:

      interface InterfaceBug {

        int i = 10, j, k;
      }


      Old javac rightly rejects this, since j and k have not been initialized.
      Note that you cannot get 1.3 to accept:

      interface InterfaceBug {

        int i, j, k;
      }

      gilad.bracha@eng 1999-10-20

            wmaddoxsunw William Maddox (Inactive)
            gbrachasunw Gilad Bracha (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: