Name: vi73552 Date: 05/04/99
This compiles and runs without any error at runtime on JDK1.2.1
class L2 extends Object {
static void main(String args[]) {
System.out.println("L1 - main");
}
}
In JDK 1.1, we get runtime error
In class L2: main must be public and static.
1.2.1 documentation says
12.1.4 Invoke Test.main
Finally, after completion of the initialization for class Test (during which other
consequential loading, linking, and initializing may have occurred), the method
main of Test is invoked.
The method main must be declared public, static, and void. It must accept a
single argument that is an array of strings.
(Review ID: 57782)
======================================================================
- duplicates
-
JDK-4155575 (launcher) main method should have to be public
- Resolved