JAVA
EVOLUTION
Jeevan, Asst. Professor @Lovely Professional University, Punjab (India)
Contents
• Java History
• Java Features
• Java and C
• Java and C++
Jeevan, Asst. Professor @Lovely Professional University, Punjab (India)
Java History
3
Java History
4
Java Features
• Java is Simple
• Java is Object-Oriented
• Java is Distributed
• Java is Compiled and Interpreted
• Java is Robust
• Java is Secure
• Java is Architecture-Neutral
• Java is Portable and Platform-Independent
• Java’s Performance
• Java is Multithreaded
• Java is Dynamic and Extensible.
Jeevan, Asst. Professor @Lovely Professional University, Punjab (India)
Java Features
• Java is Simple
• Java is Simple, Small and Familiar
• Java is Object-Oriented
• Some people refer to Java as "C++--”
• Java is Distributed
• Many features of C and C++ that are
• Java is Compiled and Interpreted
redundant or from unreliable sources
• Java is Robust are removed. Ex. Pointers, Preprocessor
• Java is Secure header files, Multiple Inheritance, goto
• Java is Architecture-Neutral Statements
• Java is Portable and Platform-Independent
• Java’s Performance
• Java is Multithreaded
• Java is Dynamic and Extensible.
Jeevan, Asst. Professor @Lovely Professional University, Punjab (India)
Java Features
• Java is Simple
• Java is inherently object-oriented. Although
• Java is Object-Oriented many object-oriented languages began
• Java is Distributed strictly as procedural languages, Java was
designed from the start to be object-
• Java is Compiled and Interpreted oriented. Object oriented programming
• Java is Robust (OOP) is a popular programming approach
that is replacing traditional procedural
• Java is Secure programming techniques.
• Java is Architecture-Neutral • Almost everything in java is an object.
• Java is Portable and Platform-Independent
• Java’s Performance
• Java is Multithreaded
• Java is Dynamic and Extensible.
Jeevan, Asst. Professor @Lovely Professional University, Punjab (India)
Java Features
• Java is Simple
• Java is Object-Oriented
• Java is Distributed • Distributed computing involves several
• Java is Compiled and Interpreted computers working together on a network. Java
is designed to make distributed computing easy.
• Java is Robust • The URL class allows a Java application to open
• Java is Secure and access remote objects on the internet. In
Java, it is transparent if a file is local or remote.
• Java is Architecture-Neutral Using the Socket class, one can create
distributed clients and servers. New upgrades of
• Java is Portable and Platform-Independent Java support Remote Method Invocation (RMI).
• Java’s Performance
• Java is Multithreaded
• Java is Dynamic and Extensible.
Jeevan, Asst. Professor @Lovely Professional University, Punjab (India)
Java Features
• Java is Simple
• Java is Object-Oriented
• Java is Distributed
• Java is Compiled and Interpreted • Java compiler translates source
• Java is Robust code into bytecode
• Java is Secure • Java interpreter generates
• Java is Architecture-Neutral machine code that can be directly
• Java is Portable and Platform-Independent executed on the machine.
• Java’s Performance
• Java is Multithreaded
• Java is Dynamic and Extensible.
Jeevan, Asst. Professor @Lovely Professional University, Punjab (India)
Java Features
• Java is Simple
• Java is Object-Oriented
• Java is Distributed
• Java is Compiled and Interpreted
• Java is Robust • Garbage Collection
• Java is Secure
• Java has eliminated certain types of
• Java is Architecture-Neutral
error-prone programming
• Java is Portable and Platform-Independent constructs found in other languages.
• Java’s Performance
• Exception Handling
• Java is Multithreaded
• Java is Dynamic and Extensible.
10
Jeevan, Asst. Professor @Lovely Professional University, Punjab (India)
Java Features
• Java is Simple
• Java is Object-Oriented
• Java is Distributed
• Java is Compiled and Interpreted
• Java is Robust
• Java is Secure • Java implements several security
mechanisms to protect your system
• Java is Architecture-Neutral against harm caused by stray programs.
• Java is Portable and Platform-Independent • ByteCode is secure.
• Java’s Performance • Absence of pointers ensures that the
• Java is Multithreaded programs cannot gain access to
• Java is Dynamic and Extensible. memory locations without
authorization.
11
Jeevan, Asst. Professor @Lovely Professional University, Punjab (India)
Java Features
• Java is Simple
• Java is Object-Oriented
• Java is Distributed
• Java is Compiled and Interpreted
• Java is Robust
• Java is Secure
• Java is Architecture-Neutral • Write once, run anywhere
• Java is Portable and Platform-Independent • With a Java Virtual Machine
• Java’s Performance (JVM), you can write one program
• Java is Multithreaded that will run on any platform.
• Java is Dynamic and Extensible.
12
Jeevan, Asst. Professor @Lovely Professional University, Punjab (India)
Java Features
• Java is Simple
• Java is Object-Oriented
• Java is Distributed
• Java is Compiled and Interpreted
• Java is Robust
• Java is Secure
• Java is Architecture-Neutral • Portability focuses on adaptation of software in
• Java is Portable and Platform-Independent various OS, by recompiling the source to make the
binary compatible with the target OS and not
• Java’s Performance necessarily modifying the source.
• Java is Multithreaded • Platform independence focuses on ability of software
to run on VIRTUAL hardware that in turn interfaces
• Java is Dynamic and Extensible. with the PHYSICAL hardware. Examples of cross-
platform or platform independent languages are
Python, JavaScript, Java etc. 13
• Java is both portable and platform independent
Jeevan, Asst. Professor @Lovely Professional University, Punjab (India)
Java Features
• Java is Simple
• Java is Object-Oriented
• Java is Distributed
• Java is Compiled and Interpreted
• Java is Robust
• Java is Secure
• Java is Architecture-Neutral
• As Java is an interpreted
• Java is Portable and Platform Independent
language, one cannot expect the
• Java’s Performance
performance of a compiled one.
• Java is Multithreaded
• Java is Dynamic and Extensible.
14
Jeevan, Asst. Professor @Lovely Professional University, Punjab (India)
Java Features
• Java is Simple
• Java is Object-Oriented
• Java is Distributed
• Java is Compiled and Interpreted
• Java is Robust
• Java is Secure
• Java is Architecture-Neutral • Thread is basically a lightweight process, a smallest
• Java is Portable and Platform Independent unit of processing.
• Multithreading means handling multiple tasks
• Java’s Performance simultaneously.
• Java is Multithreaded • For example, you are listening to audio and watch the
• Java is Dynamic and Extensible. clips as well.
• saves time.
15
• Threads are independent so it doesn't affect other
threads if exception occur in a single thread.
Jeevan, Asst. Professor @Lovely Professional University, Punjab (India)
Java Features
• Java is Simple
• Java is Object-Oriented
• Java is Distributed
• Java is Compiled and Interpreted
• Java is Robust
• Java is Secure
• Java is Architecture-Neutral
• Dynamic: Java manipulates memory
• Java is Portable and Platform Independent in a dynamic way. Classes are loaded
• Java’s Performance by demand even across a network.
• Java is Multithreaded • Extensible: Java supports functions
• Java is Dynamic and Extensible. written in C and C++(Native functions).
Native functions are dynamically at
run time. 16
Jeevan, Asst. Professor @Lovely Professional University, Punjab (India)
Java and C • Java support
No keywords called sizeof and typedef.
• No data types called struct and union.
• No modifiers keywords as auto, extern, register, signed, and
unsigned.
• No explicit pointer type.
• does not include preprocessor and therefore we cannot use
#define, #include, #ifdef statements.
• New operators such as instanceof and >>>.
• break and continue statements.
• Add many features required for Object Oriented Programming.
Jeevan, Asst. Professor @Lovely Professional University, Punjab (India)
Java and C++ • Java support
– No Operator Overloading
– No template classes as in C++.
– No global variables (Every variables in java is declared
within a class.).
– No Multiple Inheritance (New feature called
“Inheritance” is used).
– No Pointers
– No destructors(Replaced with finalize() function).
– No header files
Jeevan, Asst. Professor @Lovely Professional University, Punjab (India)
Java • Java includes development Tools (JDK) and hundred of
classes and methods called Java standard
Library(JSL)(also called as Application Programming
Interface (API)).
• Java Development Kit is used to develop java
applications.
• Contains :
– Java Runtime Environment
– Set of development tools.
Jeevan, Asst. Professor @Lovely Professional University, Punjab (India)
Java
Java
Java Development Kit (JDK)
Application
Set of Development
Programming
Java Runtime Tools Interfaces (API)/
Java Support
Environment (Javac, java, javap, javah, Library (JSL)
(JRE) Javadoc, jdb,
AppletViewer)
Jeevan, Asst. Professor @Lovely Professional University, Punjab (India)
Java Development Tools
• Javac : Java compiler which translates source code into bytecode.
• Java : Java interpreter runs java program.
• Javadoc : Creates HTML documentation from java source code files.
• Javap(disassembler) : Converts bytecode into a program description. Its output depends on the
options used. If no options are used, javap prints out the package, protected, and public fields and
methods of the classes passed to it.
• Javah : Produces header files for use with native code.
• Jdb : Debugger which helps us find errors in programs.
• Applet Viewer : To run java programs without using java compatible browser.
Jeevan, Asst. Professor @Lovely Professional University, Punjab (India)
Application Programming
Interface (API)
• Collection of prewritten code.
• After referring to the available API classes and packages, the programmer easily invokes the
necessary code classes and packages for implementation.
– Language Support Package : Contains classes for implementing basic features of java. classes
pertaining to strings, string buffers, threads
– Utilities Package : Contains utility functions such as date and time functions.
– Input/Output Package : Collection of classes required to take input and output from user.
– Networking Package : Collection of classes for communicating over internet
– AWT Package : Classes to implement Graphical User Interface (GUI).
– Applet Package : Set of classes that allows to create java applets.
Jeevan, Asst. Professor @Lovely Professional University, Punjab (India)
Compilation
Execution
Java Runtime Environment
• Java Virtual Machine : JVM interprets the bytecode and generate the desired output. JVM is
machine dependent. i.e. JVM is different for machines with different architecture.
Byte Code (Virtual
Java Interpreter Machine Code
Machine)
• Runtime Class Libraries :
• User Interface Toolkits : AWT and Swing are the examples of toolkits that support user input.
• Deployment Technologies : Remote launch of application in the browser without installation.
Jeevan, Asst. Professor @Lovely Professional University, Punjab (India)