0 votes
in JAVA by
Is Empty .java file name a valid source file name?

1 Answer

0 votes
by
Is Empty .java file name a valid source file name?

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:

//save by .java only  

class A{  

public static void main(String args[]){  

System.out.println("Hello java");  

}  

}  

//compile by javac .java  

//run by     java A  

compile it by javac .java

run it by java A

Related questions

0 votes
asked Nov 14, 2020 in JAVA by rajeshsharma
0 votes
asked Oct 19, 2020 in JAVA by rahuljain1
...