Create the first Java program: Hello, World!

tags: java

  1. Create a new Java file
    • File suffix name .java
    • Hello.java
  2. Write code
public class Hello{
	public static void main(String[] args){  // Shortcut: PSVM or Main
		System.out.print("Hello,World!");    // Shortcut: Sout
	}
}// Class class, main method, String [] args parameter
  1. Compiling Javac Java files to generate a class file

  2. Compile the Java Class file, run the class file
    1

Must pay attention to problems

  1. The case of each word cannot be problematic, Java is sensitive
  2. Try to use English
  3. File names and class names must be guaranteed, and the initials are capitalized
  4. Symbols must be in English

Idea setting:

  1. file–>new–>model

  2. java–>jdk

  3. Project structure-> Project -> (Configure the environment)

  4. src–>new–>java class

  5. Debug: Click on the point -> Click Debug

  6. Comment words:


Note Source:Sprenzy, Java

Intelligent Recommendation

First Java program Hello World

Use Uedit Edit: Cause: The name saved by Java file must be consistent with the class name of the public class. The file name is changed to the same name!...

The first Java program Hello World!

Hello World Just built a folder New Java file File suffix name .java Hello.java [Notes] The system may not display the file suffix name, need to be opened manually Write code Compile the Javac Java fi...

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...

More Recommendation

Create your first Python program - hello world

  Create your first Python program - hello world I am using pycharm. Enter the name of the file, and then add a hello-world.py file to the list on the left.   Enter in the file Click Run; th...

Hello World: Create your first Python program

Create the first program step 1)Open PyCharm Editor. You can see the introduction screen of PyCharm. To create a new project, click Create New Project. Step 2)You need to choose a location. 1. You can...

How to create your first hello world program

1, already installed compiler Open VS2013 or VS2015, VS2017 differ slightly. 2. File -> New -> Project 3, this time, select Win32 Console Application, and then take a file name for this project,...

Use AndroidStudio to create the first program Hello World!

It's been a while since I created a blog, but I haven't written it yet. Until today, I have aspirations for leisure. I decided to write my first blog, using AndroidSutdio to create the first program H...

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...

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

Top