Jave code says main method not found on changing Java class file name [closed]


Jave code says main method not found on changing Java class file name [closed]



I used a single Java file with multiple classes (4).
Then I changed the file name to Hi.java, same as the public main method name.
On compiling, it said main method cannot be found.
Please help resolve why Java does not allow renaming the file name after developing the code.



Thanks



This question appears to be off-topic. The users who voted to close gave this specific reason:





would be nice to see the code
– nicksheen
Jul 1 at 16:51






filename should be same as class name which has main().
– roottraveller
Jul 1 at 16:52



class


main()





and make sure just one is public as you can see here stackoverflow.com/questions/13132729/…
– nicksheen
Jul 1 at 17:00





Popular posts from this blog

How to make file upload 'Required' in Contact Form 7?

Rothschild family

amazon EC2 - How to make wp-config.php to writable?