The first Java program - hello world

First program - hello world

First way

step

  1. Create a new Java file, the suffix name is changed to Java

  2. Open NOTEPAD ++ writing program source code, as shown

  3. Write a program and save, as shown

  4. Add CMD to the address bar of the Java file, open the console window, as shown

  5. Enter Javac HelloWorld.java, compile the Java file into a zona code file, generate a Class file, as shown

  6. Run the Class file through the java command, enter Java HelloWorld, get the program run results, as shown

Precautions

  • Procedure of each word does not have problems

  • Try to use the output of all English, there may be problems in the output of Chinese

  • File names and class names must be consistent

  • Don't use Chinese symbols

Compiling type and interpretation type

Second way - use Idea

  1. Open IDEA, create a new project, click Next to NEXT

  2. Right click on the SRC folder, New a java class, as shown

  3. Enter PSVM will automatically expand into main method, as shown

  4. Enter Sout will automatically expand into system.out.println ();

  5. Control the output statement of the program, as shown

  6. Click on the green arrow on the left, execute the program, as shown

Intelligent Recommendation

The first Java program Hello World !!

First Java program Output hello world !!...

The first Java program Hello, World!

Hello world Create a new folder, store the code New Java file File suffix name .java eg:Hello.java Note: The system may hide the suffix name, need to manually open Write code Compile: Javac Java file,...

Enter the first program of the Java world Hello World

Hello World Enter the first program of the Java world Hello, World! The ceremony of the program. In the Desktop New Folder (NOTO), create a subfolder (code) and establish a text in a subfile. (The fil...

Java for Selenium | The first Java program Hello World

Introduction: Is it difficult to learn Java? In the previous article, we introduced the automated test environment for Selenium Java. I hope that everyone's JDK and Eclipse are installed. Because it i...

[Java foundation] The first Java program - Hello World

Install the JDK and Java integrated development environment Eclipse, our Java learning trip is officially started. As a step in this journey, let us get the first Java program - "Hello World"...

More Recommendation

The first small program in Java, not hello, world

Non-hello, world, non-hello, world, non-hello, world Important things say three times No more nonsense, directly on the code That's right, to get into Java, the first thing we should say hello is Java...

Java learning Hello World first small program

/* The variable must be declared, assigned, and used. variable can only be valid in its scope, leaving range is invalid is not allowed to generate 2 names with the same name in the same scope. */...

Java first program hello world and note

classPath (can execute .class file anywhere If the classPath is not configured, it will automatically go to the current directory to find the bytecode of the specified name. If the classPath is config...

My first hello world program JAVA

Learning any language, the first program is hello world. Just beginning to learn java junior partner, I suggest writing code in Notepad so you can lay a better foundation for the next. First create a ...

And teach others the first java program. Not a hello world!

Under eclipse and other development tools are packed situation. java project java engineering means After Next, fill in the project name here Click finish After filling, meaning complete Then cre...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top