Lecture 1 Handout Introduction Object Oriented Programming1
Lecture 1 Handout Introduction Object Oriented Programming1
Objectives
1
Syllabus of Course
W Topics Date Lect Task
6Introduction to Java Networking, Applets, Graphics Okt-15 KLM reading Chap 11 (Cisco-Sun)
Java Networking: Applets, Remoted Method Invocation
7 (RMI) Okt-23 KLM Overview all read chapters
Mid-Test 25-30-Okt
References
2
Lecture 1
Introduction to
Object Oriented Programming
3
Hardware components
Software and programming
Introduction to Java
Integrated Development Environment
(IDE
IDE)
IDE
4
Instructions that tell the hardware
what to do
Three ways to obtain software
◦ Buy pre-written software
◦ Modify pre-existing software
◦ Write the software
5
Program that controls the computer
hardware
Provides a consistent way for
applications to access the hardware
Many Operating Systems exist, mostly
incompatible with each other
Applications must be written
specifically for the target Operating
System
6
Early high-level languages were procedural
Programs were a list of sequential steps
Programmer had to think like the computer
Object-oriented Programming (OOP) uses
general purpose components
Components are then assembled in to an
application
7
Punctuation – Symbols used
Vocabulary – The languages keywords
Identifiers – Used to reference data
Operators – Symbols representing commands
Syntax – Rules for combining the language’s
elements
8
Originally designed for consumer devices
Had to be small,
small simple,
simple portable
Ideal for use over the Internet
9
Java programs written as text files
Java compiler creates a program file
consisting of ‘Byte
Byte Code’
Code
The byte-code file is sent to the target
computer, which has a Java Virtual Machine
(JVM)
The JVM ‘interprets
interprets’
interprets the byte-code, one
instruction at a time
A Separate JVM is required for each
Operating System & CPU
10
Create Java Programs with a text editor or
Integrated Development Environment (IDE)
Use a compiler to create the ‘byte-code’ class
files (Such as JDK)
A Java Virtual Machine (JVM
JVM)
JVM on the target
computers
/**
* A Java Program Comments
* @author: Student
*/
// This program will say hello
Class definition
public class sayHello { Data & methods
public static void main(String args[]) {
String name = “Student”; The ‘main’ method
int number = 1;
System.out.println(“Hello”);
System.out.println(name); Punctuation
System.out.println(“Your lucky number is “ + number);
}
}
11
12
13