Write a program that prints out “Hello World!”
public class HelloWorld {
—-public static void main ( String[] args) {
——–System.out.println(“Hello World!”);
—–}
}
What to main types does Java have?
Primitive types
Non-Primitive types/Classes
What are the primitive types?
What are the non-primitive types?
What is scope of a variable?
Scope is where a variable can be used in a script. A variable can only be used inside the block in which it was declared.
How do you create a variable?
In java variables have both a type and a name, so all variables must be declared before use.
int x;
int defines the type of variable and x is the name of the variable.