Sunil Sunny wrote: Welcome to this Forum
If your program contains more than one classes . then you must only declare one public class only and name save that with your publiclassname.java . Hope this will also help you.
Are you talking about single file? Ideal practice is - create a different file for each class. That way, it becomes easy to maintain the application.
Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)