ProAnswers.org

Is Empty.java file name a valid source file name?

Yes, save your java file by .java only, compile it by javac .java and run by java yourclassname 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