You have to declare main as static.main is the entry point of a class. In java everything thing is written in a class.Now when you run java filename on command prompt, loader will load the class and jvm will search the main method to enter into the class. so making the main() as static, will make jvm access it directly through classname.main()
posted 5 years ago
You have to find the main method before an instance can be created. A static method can be found as soon as the class has been loaded. So the JVM is looking for a method with the headingpublic static void main(String ???).
His brain is the size of a cherry pit! About the size of this ad:
the new thread boost feature brings a LOT of attention to your favorite threads