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

Extension of 'Interface' definition to include class (static) methods.

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 1.1.4, 1.1.5, 1.2.2, 1.3.0, 1.4.0, 1.4.1, 1.4.2, 6, 7
    • Fix Version/s: 7
    • Component/s: specification
    • Subcomponent:
    • CPU:
      generic, x86
    • OS:
      generic, linux, windows_95, windows_98, windows_2000, windows_xp

      Description

      Name: rm29839 Date: 11/18/97


      Please extend the definition of an 'Interface'
      to include class (static) methods.

      Currently, attempting to expose class methods
      via an interface generates a compiler error, e.g.

      MyInterface.java:2: Interface methods can't be
      native, static, synchronized, final, private,
      or protected : void classMethod()
          public static void classMethod ();

      This limitation forces one to create two classes
      and two interfaces (which in turn creates other
      difficulties), instead of one of each, in order
      to publish class methods e.g. 'Orders' and 'Order'
      classes and interfaces. Visual Basic's lack of
      class methods forces one to do the same thing.

      Noting the other exclusions above, I would also
      question why interfaces cannot have final or
      synchronized methods.
      (Review ID: 19893)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                abuckley Alex Buckley
                Reporter:
                rmandelsunw Ronan Mandel (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: