Qus:    Is Empty .java file name a valid source file name?
Feb 06, 2021 08:31 1 Answers Views: 414 VAMSI
Prev Next
Answers (1)
SANJAY Feb 08, 2021 08:17
Answer:   Yes, Java allows to save our java file by .java only, we need to compile it by javac .java and run by java classname Let's take a simple example:
1. //save by .java only
2. class A{
3. public static void main(String args[]){
4. System.out.println("Hello java");
5. }
6. }
7. //compile by javac .java
8. //run by java A
compile it by javac .java
run it by java A

Post Your Answer
Guest User

Not sure what course is right for you?

Choose the right course for you.
Get the help of our experts and find a course that best suits your needs.

Let`s Connect