Chapter 2-Introduction To Java
Chapter 2-Introduction To Java
Introduction to Java
J V D Prasad
Assistant Professor, CSE Department
Overview
• What is Java?
• History of Java
• Java Buzzwords
What is a Java?
• A general-purpose computer programming language designed
to produce programs that will run on any computer system.
History of Java
• James Gosling, Mike Sheridan, and Patrick Naughton
5
Why the Name “Java”?
• Java is an island of Indonesia where first coffee was
produced (called java coffee).
• Java is an Island Famous for Coffee seeds.
• In 1995, Time magazine called Java one of the Ten Best
Products of 1995.
Where it is used?
• Desktop Applications.
– A desktop application means any software that can be installed on a
single computer (laptop or a desktop) and used to perform specific
tasks such as acrobat reader, media player, antivirus etc.
• Web Applications.
– A web based application is a software package that can be accessed
through the web browser.
7
Types of Java Applications
• Standalone Application
– An application that we need to install on every machine.
• Web Application
– An application that runs on the server side and creates
dynamic page.
• Enterprise Application
– An application that is used to satisfy the needs of
an organization rather than individual users.
• Mobile Application
– An application that is created for mobile devices.
Where it is used?
• Mobile Applications.
– A mobile app is a software application designed to run on mobile
devices such as smartphones and tablet computers.
• Embedded Applications.
– A software application that permanently resides in an industrial or
consumer device.
Java Editions
• Three editions of java platform make it easier for software
developers, web developers, service providers and device
manufacturers to target the commercial market.
Java Versions
• JDK Beta (1995)
• JDK 1.0 (23rd Jan, 1996)
• JDK 1.1 (19th Feb, 1997)
• J2SE 1.2 (8th Dec, 1998)
• J2SE 1.3 (8th May, 2000)
• J2SE 1.4 (6th Feb, 2002)
• J2SE 5.0 (30th Sep, 2004)
• Java SE 6 (11th Dec, 2006)
• Java SE 7 (28th July, 2011)
• Java SE 7 updated ( February 2013 )
• Java SE 8 (March 2014 )
• Java SE 9 (March 2018)
Java Features/Buzzwords
• Java is a Simple
• Java is Platform Independent.
• Java is Compiled and Interpreted.
• Java is Portable.
• Java is a Dynamic Language.
• Java is Secured.
• Java is Robust.
• Java is a Distributed Language.
• Java is a Multithreaded Language.
• Java is Architectural Neutral.
• Java is High in Performance
• Java is a OOP Language.
Java is Simple
• Simplicity of Java is the professional programmers could learn it
quickly and use effectively. (Familiar)
• Java derives it Syntax from C language.
• Many of Java’s OOP Features adopted from C++.
• Java was designed to make it much easier to write bug free code. [
Bug Free System ]
• Efficient Memory management ( Automatic )
• Removed many confusing and/or rarely-used features e.g., structures,
unions, explicit pointers, typedef, operator overloading etc.
• Java Removes Complexity because it doesn’t use pointers, Storage
Classes and Goto Statements and java doesn’t support Multiple
Inheritance.
Java is Platform Independent
• The concept of Write-once-run-anywhere (known as the
Platform independent) is one of the important key feature of
java language that makes java as the most powerful language.
JVM is a platform
dependent , Where Java is
Platform independent
Java is Robust
Java has the strong memory allocation and automatic garbage
collection mechanism. (Automatic memory management and
garbage collection )
• Java uses the public key encryption system to allow the java
applications to transmit over the internet in the secure encrypted
form.
Java is Compiled & Interpreted
• Java is a compiled programming language, but rather
than compile straight to executable machine code,
it compiles to an intermediate binary form called JVM
byte code. The byte code is then interpreted to run the
program.
• JIT Compiler.
Java is Portable
Java Runtime Environment is a plug-in needed for Java Development Kit is needed for
running java programs. developing java applications.
The JRE is smaller than the JDK so it needs less The JDK needs more Disk space as it
Disk space. contains the JRE along with various
development tools.
The JRE can be downloaded/supported freely The JDK can be downloaded/supported
from freely from
oracle.com oracle.com/technetwork/java/javase/down
loads/
It includes the JVM, Core libraries and other It includes the JRE, set of API classes,
additional components to run applications and Java compiler, Web start and additional
applets written in Java. files needed to write Java applets and
applications.
Java is Object Oriented
• Influenced by C++
• “Everything is an Object” Paradigm
• Fields and methods are closely tied to the object's real world
characteristics and behavior.
• Object-oriented programming(OOPs) is a methodology that
simplify software development and maintenance by
providing some rules.
Single class
Inheritance N/A Multiple class inheritance inheritance, multiple
interface implementation
Operator Overloading N/A Yes No
Automatic coercions Yes, with warnings if Yes, with warnings if loss Not at all if loss could
(Conversion) loss could occur could occur occur; must cast explicitly
Goto Statement Yes Yes No