“Hello World” In Java Mehdi Einali Advanced Programming in Java 1
2 Agenda Review First program in java Variables Methods Conditions Loops
3 Review Java is Simple object oriented Robust And popular Java is platform independent. Write Once, Run Anywhere!
4 Hello World Create a file named First.java Java class files have.java extension Note to naming convention Copy this lines to the file Note: File name and class name should be the same.
5
6 Debuging Syntax Error Run-time errors exceptions logic or semantic error The semantics, or meaning of the program, are wrong
7 Java Programs A simple java program is a file The file contains one class The class name equal to the file name The names are case sensitive The class contains a main method When we run the program, the main method is executed
8 Variables What is a variable? A piece of memory Holds data For example a number, string or Boolean Java variables have a fixed size Platform independence
9 Java Primitive Types
10 Arithmetic Operators
11 Operator Precedence * 3 = ? is treated as 1 + (2 * 3)
12 Equality and Relational Operators
13 Operators
14 Excersize
15 KHokhan Stubborn Crazy Untidy Stochastic Hate other khokhans And Love Chaos