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

javac, incomplete error message

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 8, 9
    • tools
    • b08
    • Verified

      If this program is compiled:

      class Super {
          static void m() {}
      }

      class Sub extends Super {
          private static void m() {}
      }

      you obtain this error message:

      Test2.java:6: error: m() in Sub cannot override m() in Super
          private static void m() {}
                              ^
        attempting to assign weaker access privileges; was <----- was what?
      1 error

      if the static modifier is removed in both methods then the error message specify that the access was "package"

            kizune Alexander Zuev
            vromero Vicente Arturo Romero Zaldivar
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: