Java Introduction
Java Introduction
ROGRAMMING
Reference Books
• The complete Reference Java2(10th Edition)
• Herbelt Schildt, Tata Mc Graw Hill
• Object Oriented Programming with C++ and Java
• Debasis Samanta, Perntice Hall of India
• Inside Java Virtual Machine”, 2nd Ed
• Bill Vanners , TMH,
• Java How to Program
• Paul Dietel and Harvey Deitel ,PHI, 8th Ed., 2010
04/23/24 Introduction to Java 3
History of Java
• Java is a general purpose, object oriented programming language
platform developed by Sun Microsystems in 1991,
• Java was conceived by James Gosling, Patrick Naughton, Chris
Warth, Ed frank and Mike Sheridan at sun Microsystems.
• Firstly it was called “Greentalk” by James Gosling and file extension
was .gt.
• Later renamed “Oak”, finally but renamed “java” in 1995.
• Java is an island in Indonesia. It is very famous for coffee, James
Gosling is very fond of coffee.
• Java technology was incorporated by “Netscape”
• In 1995, Time magzine called java one of the best products of
1995.
• JDK (Java Development Kit) 1.0 released in January 23, 1996.
04/23/24 Introduction to Java 4
C++ Java
C
04/23/24 Introduction to Java 7
JAVA Vs C++
• No More header files, Typedefs, Defines, or Preprocessor -
Packages
• No More Structures or Unions –Instance variables,No Enums
• No More Functions –only methods
• No More Multiple Inheritance but support interfaces.
• Java does not support global variable.
• No More Goto Statements
• No More Operator Overloading
• No More Pointers
• Java does not have template class as in C++
• No More Automatic Coercions :Datatype conversion
• Java had replaced the destructor function within a finalize()
function.
04/23/24 Introduction to Java 9
Platform Dependent
04/23/24 Introduction to Java 11
Java Platforms
• Java SE:
• Java Middleware Editions
• Java server cards
04/23/24 Introduction to Java 14
Java Features
• Java is simple, small and familiar : Because java inherits the C/C++
syntax and many of OOPS features of C++.
Java does not use pointers, preprocessor header files, goto
statement and many more. It also eliminates operator overloading
and multiple inheritance.
It is modeled on C and C++ , so syntax is familiar.
• Complied and Interpreted: Java is two stage system that combines
both compilation and interpretation. Firstly java compiler translate
source code into bytecode instruction, then java interpreter converts
bytecode into machine code and run java program.
• Platform Independent and Portable: java programs can be easily
moved from one computer system to another, anywhere and
anytime. Changes in OS, processor and system resources will not
force and changes in java program. Because: I : java compiler
generates bytecode not machine language which is machine
independent. II:size of primitive data types are machine independent.
• Object Oriented: java is true object oriented. All program code and
data reside within objects and classes.
04/23/24 Introduction to Java 15
Bytecode
The key that solves both security and portability problems
is the Bytecode, output of java compiler which is not
executable code.
It is highly optimized set of instructions designed to be
executed by the java runtime system, which is called the
java Virtual Machine(JVM). JVM is an interpreter for
bytecode.
Translating a java program into bytecode makes it much
easier to run a program in a wide variety of environments
because only the JVM needs to be implemented for each
platform. Once a runtime package exists for given
system, any java program can run on it.
04/23/24 Introduction to Java 19
JVM an Emulator
04/23/24 Introduction to Java 22