Presentation is loading. Please wait.

Presentation is loading. Please wait.

“Hello World” In Java Mehdi Einali Advanced Programming in Java 1.

Similar presentations


Presentation on theme: "“Hello World” In Java Mehdi Einali Advanced Programming in Java 1."— Presentation transcript:

1 “Hello World” In Java Mehdi Einali Advanced Programming in Java 1

2 2 Agenda Review First program in java Variables Methods Conditions Loops

3 3 Review Java is Simple object oriented Robust And popular Java is platform independent. Write Once, Run Anywhere!

4 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 5

6 6 Debuging Syntax Error Run-time errors exceptions logic or semantic error The semantics, or meaning of the program, are wrong

7 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 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 9 Java Primitive Types

10 10 Arithmetic Operators

11 11 Operator Precedence 1 + 2 * 3 = ? is treated as 1 + (2 * 3)

12 12 Equality and Relational Operators

13 13 Operators

14 14 Excersize

15 15 KHokhan Stubborn Crazy Untidy Stochastic Hate other khokhans And Love Chaos


Download ppt "“Hello World” In Java Mehdi Einali Advanced Programming in Java 1."

Similar presentations


Ads by Google