0
Java main() method
Is the main method the only static method in any program? Can only the main() method create objects?
3 Réponses
+ 4
The main method is the entry point for the JVM. You don't necessarily need to create all objects in the main method, you're free to create an object there that creates an object that creates an object etc.
Also, the main method doesn't necessarily needs to be the only static method in your program, your free to use other classes that contain static methods or to invoke other static methods in the class that contains the main method.
+ 1
using deserialisation method we can create objects in java.
0
using new Keyword,using clone() method you can create the objects