My first Java program, the first Java program
My first Java program:
Class Test
{
Public static void main (String [] args)
{
System. out. println ("this is my first java program ");
}
}
Note: The first letter of the class name must be capitalized.
Procedure:
1. Create a Java source program in Notepad (or UE)
Or
Note: The file extension is. java. Strict attention should be given to spaces and upper and lower cases. The colon and semicolon must be entered in English.
2. Compile:
3. Execute:
Note: The name of the Java program I created overlaps with the class name. The Java Test command is used during execution. Here, Test refers to the Test (class Name) after the class in the text ).
Here are some notes:
1. Multiple classes can be written in a source file;
2. If the class declares the public type, the class name must be the same as the source file name;
3. Only one class declared by public can be found in the same source file.
Three annotations are described here:
1. // The comment here
2 ./*
Note
*/
3 ./**
* Comment
* Comment
* Comment
* Comment
*/