cannot run a simple java code

前端 未结 5 1685
离开以前
离开以前 2021-01-22 11:45

I have downloaded a java developers kit for my 64bit windows 7, wrote down my code in the notepad, though the code is compiling from the command prompt and creating a .class fil

5条回答
  •  猫巷女王i
    2021-01-22 12:30

    A java program has this basic structure:

    ClassName.java

    public class ClassName
    {
        public static void main(String[] args)
        {
    
        }
    }
    

    try using this outline to generate your code.

    compile and run with:

    javac ClassName.java
    java ClassName
    

提交回复
热议问题