2 Fundamentals of Java Language
2 Fundamentals of Java Language
Language
class HelloWorld{
public static void main(String args[ ]){
System.out.println(“Hello World”);
}
}
Identifiers
Keywords
Comments
Data types
JAVA LANGUAGE FUNDAMENTALS
Variables
Variable Declaration
Syntax: <datatype> <varName>; [=
value;]
Example: String name;
int age;
double price = 55.66;
Assigning a value
Syntax: <varName> = value;
Example: name = “Maria Blanco”;
age = 22;
price = 200.50;
JAVA LANGUAGE FUNDAMENTALS
Wrapper Classes