I. Steps to develop a Java program
1. Writing the source program
2. Compiling
3. Running
Two. Structure of Java Programs
1. Writing a procedural framework
public class helloworld{}
Note: HelloWorld is the name of the class, which is exactly the same as the name of the program file
2. Framework for writing the main () method
public static void Main (string[] args) {}
Note: A program can have only one main () method
3. Writing code
System.out.println ("Hello world!!!"); | | System.out.print ("Hello world!!!");
Note: println () wraps the information in quotation marks after it is printed.
Print () does not wrap after printing the information in quotation marks
Three. Escape character
\ n: Moves the cursor to the first pane of the next line
\ t: Moves the cursor to the next horizontal tab position
Four. Notes for Java programs
Single-line Comment: "//" starts with
Multiline Comment: "/*" ends
Five. Java Coding specification
1. Class names must be decorated with public
2. Write only one statement in a row
3. "{" is generally placed at the bottom of the start line of this structure, "}" is aligned with the first letter of the structure and takes up a separate line
4. A lower-level statement or comment should indent the TAB key at a higher-level statement or comment in writing
First knowledge of Java