When I started learning Java, I learnt that it was required for the file containing the main class to be given the same name as that of the class itself. This not entirely true. One can name the file anything they want, as long as the public access modifier is not applied to it. The program will compile and run. I came to know about this when my friend +Aniket Mazumdar told me about it. I didn't believe him at first. But after doing some research, it seems that he was right. Shout out to him!
Comments
Post a Comment
Share your thoughts...