-
I have a class(1) having some constructors(arg and no args).
In another class(2) an object of Class 1 is created using new constructor(). So will main method get called in this case? -
Ideally when is main method called in any class?
I have a class(1) having some constructors(arg and no args). In another class(2) an
Share
mainis a static method, the entry point for the program, and is called once (unless you explicitly call it), when the program starts, not for each object initialization.