OOP Lecture 01
OOP Lecture 01
OOP Lecture 01
Programming
Java
1
Procedural Oriented
Programing (POP)
Program is divided into small parts called
functions
Importance is not given to data but to
2
POP Cont…
To add new data and function in POP is not
so easy
In POP, Most function uses Global data for
Pascal 3
Object Oriented
programing(OOP)
Program is divided into parts called objects
Importance is given to data rather than
security
In OOP, overloading is possible in the form of
C#.NET 5
POP SRUCTURE……
Main Function
Function 2 Function 5
Function N
6
OOP SRUCTURE……
Class 1 { Class 2 {
Data Data
Methods Methods
} }
Class n {
Data
Methods
}
7
Java
General purpose programming language
Is simple
Is scalable
Is object oriented
8
Java
A Programming Language and a Platform
Java Platform
Java Virtual Machine (Java VM)
Java Application Programming Interface
9
Java
It
is Platform Independent (Write Once Run
Anywhere)
10
Advantages of Java
Easy to learn, Familiar C++ like syntax
Pure Object Oriented Language
Extensive API, which means that
programmers write lesser amount of code
Extensive Documentation
Faster Application Development because of
code re-use
Platform Independence
Automatic Garbage Collection
11
History of Java
Project Green by Sun Microsystems to create
a pure object oriented language based on C+
+, to overcome the limitations and
complexities of C++ (1990)
Aimed at embedded systems in consumer
12
History of Java
Failedto win recognition in embedded
systems and embedded systems were not
making a rapid progress
During the same period world wide web
14
Use of Java
Desktop Applications such as acrobat reader,
media player, antivirus etc.
Web Applications such as irctc.co.in,
javatpoint.com etc.
Enterprise Applications such as banking
applications.
Mobile
Embedded System
Smart Card
Robotics
15
Games etc.
Different Java Technologies
JVM (Java Virtual Machine): is an abstract machine.
It is a specification that provides runtime
environment in which java bytecode can be
executed.
JVMs are available for many hardware and software
platforms. JVM, JRE and JDK are platform
dependent because configuration of each OS
differs. But, Java is platform independent.
The JVM performs following main tasks:
Loads code
Verifies code
Executes code
J2ME combines a resource constrained JVM and a set of
Java APIs for developing applications for mobile devices
16
22
Compilation and Execution of
a Java Program
Compile the source file
Use the Java compiler :
javac HelloWorld.java
A byte code file (i.e. a file understandable by the
Java Virtual Machine) is created
Run the program contained in the byte code
file
Use the command :
java HelloWorld
23