Post Closed as "duplicate" by gnat, unholysampler, user22815, GlenH7, durron597 of
2 Fix spacing around punctuation and capital letters.
source | link

Any javaJava code will always have a class which has the same name as that of the file  . The whole designed program resides inside this class. However,in in C++ we don't have this provision. What is the rationale behind this approach where the whole code resides inside a class(or? What extra advantage does this provide  ? ). Can we create objects of this class and call the main function of this class as many times as we wish  ?

Any java code will always have a class which has the same name as that of the file  . The whole designed program resides inside this class. However,in C++ we don't have this provision. What is the rationale behind this approach where the whole code resides inside a class(or What extra advantage does this provide  ? ). Can we create objects of this class and call the main function of this class as many times as we wish  ?

Any Java code will always have a class which has the same name as that of the file. The whole designed program resides inside this class. However, in C++ we don't have this provision. What is the rationale behind this approach where the whole code resides inside a class? What extra advantage does this provide? Can we create objects of this class and call the main function of this class as many times as we wish?

1
source | link

The eponymous class of java

Any java code will always have a class which has the same name as that of the file . The whole designed program resides inside this class. However,in C++ we don't have this provision. What is the rationale behind this approach where the whole code resides inside a class(or What extra advantage does this provide ? ). Can we create objects of this class and call the main function of this class as many times as we wish ?