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

Clarify if public static main method is allowed in anonymous/local class

    XMLWordPrintable

    Details

    • Type: Task
    • Status: New
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: tools
    • Labels:
      None

      Description

      JDK-8261785 raised the question if such method should be allowed in launcher.

      The static method is allowed in local and anonymous class by JEP-395, so that it's possible to define 'main' method and launched with `java` command as long as user can specify the class.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            henryjen Henry Jen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: