why we have to declare the main function inside the class and we have to save the file name ( .java) as the class (which contains the main function) name why............what's the reason ?

Can we use another name for the saving the .java file ...........

Can we use another name for the saving the .java file ...........

off course you can, you just won't be able to compile the file any more, that's all.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.