You are on page 1of 25

Java Programming

COSC 450

Dr. Mohamad EL ABED

1 Spring 2014

Course text book & software
Paul Deitel and Harvey Deitel, “Java How to Program”, 9 / e NetBeans IDE (http://netbeans.org/)

Evaluation profile
Attendance, Assignments and Lab 1 Mid. Exam 2 Projects

Marks
20% 20% 30%

Final Exam

30%

Office: Block I – 208 Office hours: Wednesday 02:00 – 04:00 E-mail: alabedma@rhu.edu.lb
2

Course objectives  Concept of Object-Oriented Programming OOP  Use of a high level programming language (Java) for the systematic development of programs  Data structures: Stacks and Queues  To build desktop applications using the design principles of Graphical User Interface (GUI)  Understand the notion of multithreading  Introduction to Weka Library and machine learning algorithms 3 .

Introduction to Java Applets IX.Syllabus I. Object-Oriented Programming: Inheritance and Polymorphism VII. Graphical User Interface (GUI) Components VIII. Documenting with Javadoc V. II. Java Multithreading X. Introduction to Java Applications Control Statements III. Introduction to Weka Library 4 . Introduction to Object-Oriented Programming (OOP) VI. Arrays in Java IV.

Mohamad EL ABED Chapter I Introduction to Java Applications 5 .Java Programming COSC 450 Dr.

Chapter I .Objectives  To be able to write simple Java applications  To be able to use input and output statements  To be able to use arithmetic operators  To be able to write decision-making statements  To be able to use relational and equality operators 6 .

Chapter I .Outline  History of Java  Why Java and How it Works?  First Program in Java: Printing a Line of Text  Escape Sequences  Displaying Text in a Dialog Box  Another Java Application: Adding Integers  Arithmetic  Decision Making: Equality and Relational Operators 7 .

History of Java  Java is developed by James Gosling at Sun Microsystems and released in 1995  Java provides the capabilities for Object-Oriented Programming (OOP)  C. C++ and Java are widely used in real life applications 8 .

Outline  History of Java  Why Java and How it Works?  First Program in Java: Printing a Line of Text  Escape Sequences  Displaying Text in a Dialog Box  Another Java Application: Adding Integers  Arithmetic  Decision Making: Equality and Relational Operators 9 .Chapter I .

. sockets)  Multi-threaded (i..Platform independent programming language  Pointer denial – reduces chances of virulent programs corrupting host  Provides the capabilities of Object-Oriented Programming (OOP)  Designed for network programming (i.Why Java?  Portable .e.e. multiple simultaneous tasks) 10 .

How it Works? 11 .

Outline  History of Java  Why Java and How it Works?  First Program in Java: Printing a Line of Text  Escape Sequences  Displaying Text in a Dialog Box  Another Java Application: Adding Integers  Arithmetic  Decision Making: Equality and Relational Operators 12 .Chapter I .

First Program in Java: Printing a Line Text Output 13 .

Outline  History of Java  Why Java and How it Works?  First Program in Java: Printing a Line of Text  Escape Sequences  Displaying Text in a Dialog Box  Another Java Application: Adding Integers  Arithmetic  Decision Making: Equality and Relational Operators 14 .Chapter I .

Escape Sequences 15 .

Chapter I .Outline  History of Java  Why Java and How it Works?  First Program in Java: Printing a Line of Text  Escape Sequences  Displaying Text in a Dialog Box  Another Java Application: Adding Integers  Arithmetic  Decision Making: Equality and Relational Operators 16 .

Displaying a Text in a Dialog Box Output 17 .

Chapter I .Outline  History of Java  Why Java and How it Works?  First Program in Java: Printing a Line of Text  Escape Sequences  Displaying Text in a Dialog Box  Another Java Application: Adding Integers  Arithmetic  Decision Making: Equality and Relational Operators 18 .

Another Java Application: Adding Integers 19 .

Another Java Application: Adding Integers Output 20 .

Outline  History of Java  Why Java and How it Works?  First Program in Java: Printing a Line of Text  Escape Sequences  Displaying Text in a Dialog Box  Another Java Application: Adding Integers  Arithmetic  Decision Making: Equality and Relational Operators 21 .Chapter I .

Arithmetic 22 .

Outline  History of Java  Why Java and How it Works?  First Program in Java: Printing a Line of Text  Escape Sequences  Displaying Text in a Dialog Box  Another Java Application: Adding Integers  Arithmetic  Decision Making: Equality and Relational Operators 23 .Chapter I .

Decision Making: Equality and Relational Operators 24 .

End of Chapter I 25 .