Java | Structure: The general structure of Java program, here you will learn to execute statement and fix the common syntax errors.
Step by Steps:
- First create the class name as Main.
- Add main method (public static void main(String[] args), it is the beginning point of execution.
- Use println for print the statements.
- Most common syntax errors are missing semicolon and unbalanced brackets.
- Comments are created with // for code understanding purpose, comments are not executed.
Here is the Code:
- import java.io.*;
- class Main {
- public static void main (String[] args) {
- //Comments...
- System.out.println("Structure of Java.");
- }
- }
Here is the Video: