Lecture 1 - Java Boilerplate, Variables Data Types- NUST
Lecture 1 - Java Boilerplate, Variables Data Types- NUST
❖
Argument must be (String[] args), can written as (String args[])
❖
We will declare other methods (functions) in a class, but the main()
function is the one the JVM looks for when executing your code
The Body of main() Method
❖
Body is surrounded by a set of curly braces:
{ : opening brace (the beginning of the body)
// code within braces
} : closing brace (the end of the body)
❖
Each statement in the body MUST end in a semi-colon
(;)
The Variable
The Variable
The Variable
Declaration
int age;
Assignment
age = 21;