2021年3月17日星期三

Why I need to write the .java extension while running my java program?

public class Hello  {      public static void main(String[] args)      {          System.out.println("HelloWorld");      }  }  

Here is the simple Hello world program. The code is compiling perfectly but when I am trying to run the program with "java Hello" statement there comes an error of class not found exception which is a right statement to run java code but when I write "java Hello.java" providing extension the output comes, what I should do to solve my this error?

https://stackoverflow.com/questions/66684327/why-i-need-to-write-the-java-extension-while-running-my-java-program March 18, 2021 at 11:28AM

没有评论:

发表评论