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

defining interface method static causes misleading error

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.0fcs
    • CPU:
      sparc
    • OS:
      generic
    • Verification:
      Not verified

      Description

      Consider the following code:

      interface Foo {
          void NonStatic();
      }
       
      final class ack implements Foo {
          static void NonStatic() {
          }
      }


      When I compile this I get:

      static.java:6: Static methods can't be overridden. Method void NonStatic() is static in interface Foo.
          static void NonStatic() {
                      ^
      1 error

      This error message is a bit confusing because NonStatic in Foo is not static.

      DREL 10/28/95

        Attachments

          Activity

            People

            Assignee:
            fyellinsunw Frank Yellin (Inactive)
            Reporter:
            dlong Dean Long
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: