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

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

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • 7
    • 1.1.4, 1.1.5, 1.2.2, 1.3.0, 1.4.0, 1.4.1, 1.4.2, 6, 7
    • specification
    • generic, x86
    • generic, linux, windows_95, windows_98, windows_2000, windows_xp

      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)
      ======================================================================

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: