小黑框程序和错误提示
//define a class
public class Welcome {
//define main method
public static void main(String[] args) {
//statement
ClassBlock System.out.println("Hello World!");
} }
- There are three types of common error:
-
Syntax Error:Detected by the complier are called syntax or compile errors.
-
Run Time Errror: Cause a program to terminate abnormally.
-
Logic Errors: When a program does not perform the way it was intended to.
-
Classes
- Java program must have at least one class.
- class names start with an uppercase letter.
Methods
- A collection of statements that performs a sequence of operations to display a message on the console.
- String argument.