2. 2
Procedural Oriented
Programing (POP)
Program is divided into small parts called
functions
Importance is not given to data but to
functions as well as sequence of actions to
be done
Does not have any access specifies
In POP, Data can move freely from function
to function in the system
Prepared by: Said H Said
The University of Dodoma
3. 3
POP Cont…
To add new data and function in POP is not
so easy
In POP, Most function uses Global data for
sharing that can be accessed freely from
function to function in the system
POP does not have any proper way for hiding
data so it is less secure
In POP, Overloading is not possible
Example of POPL are : C, VB, FORTRAN,
Pascal
Prepared by: Said H Said
The University of Dodoma
4. 4
Object Oriented
programing(OOP)
Program is divided into parts called objects
Importance is given to data rather than
procedures or functions to mimic real world
realm
OOP has access specifies named Public,
Private, Protected, etc
In OOP, objects can move and communicate
with each other through member
functions/methods
Prepared by: Said H Said
The University of Dodoma
5. 5
OOP cont…..
OOP provides an easy way to add new data
and function/methods
In OOP, data cannot move easily from function
to function, it can be kept public or private so we
can control the access of data
OOP provides Data Hiding so provides more
security
In OOP, overloading is possible in the form of
Function Overloading and Operator Overloading
Example of OOP are : C++, JAVA, VB.NET,
C#.NET Prepared by: Said H Said
The University of Dodoma
7. 7
OOP SRUCTURE……
Class 1 {
Data
Methods
}
Class 2 {
Data
Methods
}
Class n {
Data
Methods
}
Prepared by: Said H Said
The University of Dodoma
8. Java
General purpose programming language
Is simple
Is scalable
Is object oriented
Is similar to C and C++
8
Prepared by: Said H Said
The University of Dodoma
9. 9
Java
A Programming Language and a Platform
Java Platform
Java Virtual Machine (Java VM)
Java Application Programming Interface
Prepared by: Said H Said
The University of Dodoma
10. 10
Java
It is Platform Independent (Write Once Run
Anywhere)
Prepared by: Said H Said
The University of Dodoma
11. 11
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
Prepared by: Said H Said
The University of Dodoma
12. 12
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
electronic devices (interactive television,
VCR, washing machines, etc.)
Originally named ‘Oak’
Prepared by: Said H Said
The University of Dodoma
13. 13
History of Java
Failed to win recognition in embedded
systems and embedded systems were not
making a rapid progress
During the same period world wide web
(www) was going through an exponential
growth
Oak was aimed at supporting interactive web
pages together with the development of a
new web browser, Web Runner (1994)
Prepared by: Said H Said
The University of Dodoma
14. 14
History of Java
‘Oak’ renamed ‘Java’ and ‘Web Runner’
renamed ‘Hot Java’
Formal Announcement of Java Language
and Hot Java browser in Sun World ’95
Commercial web browsers starting with
Netscape begin supporting Java
Later Java evolved into other technologies
like Java applets (interactive web content)
Prepared by: Said H Said
The University of Dodoma
15. 15
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
Games etc.
Prepared by: Said H Said
The University of Dodoma
16. Prepared by: Said H Said The University of
Dodoma
16
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
Provides runtime environment
Prepared by: Said H Said
The University of Dodoma
17. 17
Different Java Technologies
JRE: is an acronym for Java Runtime Environment.
It is used to provide runtime environment.
It is the implementation of JVM.
It physically exists.
It contains set of libraries + other files that JVM uses at
runtime.
Implementation of JVMs are also actively released
by other companies besides Sun Micro Systems.
Prepared by: Said H Said
The University of Dodoma
18. 18
Different Java Technologies
JDK is an acronym for Java Development Kit.
It physically exists.
It contains JRE + development tools.
Prepared by: Said H Said
The University of Dodoma
19. Prepared by: Said H Said
The University of Dodoma
19
Different Java Technologies
20. Prepared by: Said H Said
The University of Dodoma
20
Different Java Technologies
IDE’s (Integrated Development Environments): are
tools used for efficient software development
Different Components of an IDE :
Editor
Linker
Compiler
Debugger
All the different components are seamlessly
integrated in an IDE making it easy to use
21. Prepared by: Said H Said
The University of Dodoma
21
IDEs cont…
For different programming languages,
different IDE’s are available
Java Language :
JBuilder, Kawa, NetBeans, eclipse etc.
C Language :
Borland C, Turbo C, etc.
IDE’s have capabilities different from each
other and one has to learn the use of an IDE
to get the maximum return
22. 22
Compilation and Execution of
a Java Program
Create a source file (e.g. :- a file named
“HelloWorld.java”) and type in the source code.
/**
* The HelloWorld class implements an application that
* displays "Hello World!" to the standard output.
*/
public class HelloWorld {
public static void main(String[] args) {
// Display "Hello World!"
System.out.println("Hello World!");
}
}
Prepared by: Said H Said
The University of Dodoma
23. 23
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
Prepared by: Said H Said
The University of Dodoma