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

abstract and other method modifiers

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.1.5, 1.2.0
    • tools
    • generic, x86
    • generic, windows_95



      Name: rm29839 Date: 12/11/97


      The language spec states the following:
      8.4.3 Method Modifiers

           MethodModifiers:

                   MethodModifier

                   MethodModifiers MethodModifier

           MethodModifier: one of

                   public protected private

                   abstract static final synchronized native

      The access modifiers public, protected, and private are discussed in §6.6. A compile-time error occurs if the same modifier appears more than
      once in a method declaration, or if a method declaration has more than one of the access modifiers public, protected, and private. A
      compile-time error occurs if a method declaration that contains the keyword abstract also contains any one of the keywords private, static,
      final, native, or synchronized.

      If two or more method modifiers appear in a method declaration, it is customary, though not required, that they appear in the order consistent with that
      shown above in the production for MethodModifier.

      JDK1.1.5 will accept a method that has abstract and one of the other modifications
      i.e, it doesn't meet the lang. spec

      This code compiles without error on 114 and 115
      public abstract class Modifier{

        public static void main(String [] args){

          System.out.println("This is the Main Method...");


        }


       private final abstract void doesItWork();
          //abstract method
        
      }

      (Review ID: 21762)
      ======================================================================

            tturnidgsunw Todd Turnidge (Inactive)
            rmandelsunw Ronan Mandel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: