Presents
Java Introduction
ICT Academy 1
History of Java
• The Java language project was launched in June 1991
by Patrick Naughton, Mike Sheridan, and James
Gosling.
• The Green Team is a small group of solar engineers
• It was initially created for tiny embedded systems
found in electronic devices like set-top boxes.
• First of all, James Gosling called it "Greentalk," and
the file's extension was .gt.
• Following that, it was given the name Oak and was
created as a component of the Green project.
• Oak was renamed "Java" in 1995 because Oak
Technologies already owned the trademark.
ICT Academy 2
What is Java?
• Java is:
• platform independent programming language (Portable)
• similar to C++ in syntax
• Pure OO programming language
• Applications developed using Java
• Desktop
• Enterprise
• Web
• Mobile
• Embedded, Robotics, Games etc.
ICT Academy 3
Java - Features
• Java has some interesting features:
• automatic type checking,
• automatic garbage collection,
• simplified pointers; no directly accessible pointer to memory,
• simplified network access,
• multi-threading.
ICT Academy 4
Characteristics of Java
• Java Is
• Object-Oriented
• Distributed
• Interpreted
• Robust
• Secure
• Architecture-Neutral
• Portable
• Performance
• Multithreaded
• Dynamic
ICT Academy 5
Advantages of Java
• Portable - Write Once, Run Anywhere
• Security has been well thought through
• Robust memory management
• Designed for network programming
• Multi-threaded (multiple simultaneous tasks)
• Dynamic & extensible (loads of libraries)
• Classes stored in separate files
• Loaded only when needed
ICT Academy 6
Unicode System in Java
• Java follows Unicode System
• Universal international standard character encoding
• Can represent most of the world's written languages.
• Problems with different encoding formats – ASCII, etc
• Each system has a code value for different letters in the various
language standards.
• The encodings for languages with large character sets have
variable length like single byte to two or more bytes.
• In unicode, character holds 2 bytes, so java also uses 2 byte for
[Link] value:\u0000 highest value:\uFFFF
ICT Academy 7
Key Components of Java
• JVM
• Java Virtual Machine, helps to achieve portability
• Contains
• Class loader subsystem, (Dynamic class loading)
• Runtime Data areas, (PC reg, stack areas, threads etc.)
• Execution Engine (Interpreter, Compiler, GC)
• JRE
• Java Runtime Environment, helps to execute Java Programs
• JRE uses heap space for dynamic memory allocation for Java objects. JRE is also used in JDB
(Java Debugging).
• JDK
• Java Development Kit, Helps to create, compile and execute the Java Programs
• Includes Java tools, executables, binaries needed to run Java Programs
ICT Academy 8
ICT Academy 9
A Simple Java Program
[Link]
//This program prints Welcome to Java!
public class Welcome {
public static void main(String[] args) {
[Link]("Welcome to Java!");
}
}
ICT Academy 10
Anatomy of Java Program
• why Java’s main() method is public, static and void? Why its name
is main?
ICT Academy 11
ICT Academy 12
JAVA VIRTUAL MACHINE (JVM)
• The Java language is a high-level language, but Java bytecode is a low-level
language.
• The bytecode is similar to machine instructions but is architecture neutral and
can run on any platform that has a Java Virtual Machine (JVM).
• Rather than a physical machine, the virtual machine is a program that interprets
Java bytecode.
• This is one of Java’s primary advantages: Java bytecode can run on a variety of
hardware platforms and operating systems.
• Java source code is compiled into Java bytecode and Java bytecode is interpreted
by the JVM.
ICT Academy 13
ICT Academy 14