Compiling error in Java

0 votes
I created a file name test.java which contains a class named Array. How can I compile and run this? Please help.
Mar 6, 2019 in Java by Prachi
• 1,484 views

1 answer to this question.

0 votes

Generally the file name and the class name must be same. Then again if they are different, even then you can compile your code.

javac filename.java
java classname


Hope this helps!

Check out Java certification course to become certified expert.

Thanks!

answered Mar 7, 2019 by Priyaj
• 58,020 points