The document provides an overview of Java basics, including:
- Java is an object-oriented programming language and platform that was originally developed by James Gosling at Sun Microsystems in 1995.
- It discusses the Java Development Kit (JDK), Java Runtime Environment (JRE), and Java Virtual Machine (JVM) which are key components of the Java platform.
- The document also covers Java features like object-oriented programming concepts like classes, inheritance, polymorphism, and encapsulation as well as exception handling.
3. What is java?
Java is a programming language and a platform.
Java is a high level, robust, secured and object-oriented programming language.
Platform: Any hardware or software environment in which a program runs, is known as a platform. Since Java has
its own runtime environment (JRE) and API, it is called platform.
Types of Java Applications
Standalone Application
Web Application
Mobile Application
Enterprise Application
4. Where it is used?
According to Sun, 3 billion devices run java. There are many devices where Java is
currently used. Some of them are as follows:
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.
5. Java History
Java history is interesting to know. The history of java starts from Green Team. Java team members (also known as
Green Team), initiated a revolutionary task to develop a language for digital devices such as set-top boxes, televisions
etc.
1)James Gosling, Mike Sheridan, and Patrick Naughton initiated the Java language project in June 1991.
The small team of sun engineers called Green Team.
2) Originally designed for small, embedded systems in electronic appliances like set-top boxes.
3) Firstly, it was called "Greentalk" by James Gosling and file extension was .gt.
4) After that, it was called Oak and was developed as a part of the Green project.
Why "Oak" name
5) Why Oak? Oak is a symbol of strength and chosen as a national tree of many countries like U.S.A., France,
Germany, Romania etc.
6) In 1995, Oak was renamed as "Java" because it was already a trademark by Oak Technologies.
Why "Java" name
6. 7) Why had they chosen java name for java language? The team gathered to choose a new name. The
suggested words were "dynamic", "revolutionary", "Silk", "jolt", "DNA" etc. They wanted something that
reflected the essence of the technology: revolutionary, dynamic, lively, cool, unique, and easy to spell and
fun to say.
According to James Gosling "Java was one of the top choices along with Silk". Since java was so unique,
most of the team members preferred java.
8) Java is an island of Indonesia where first coffee was produced (called java coffee).
9) Notice that Java is just a name not an acronym.
10) Originally developed by James Gosling at Sun Microsystems (which is now a subsidiary of Oracle
Corporation) and released in 1995.
11) In 1995, Time magazine called Java one of the Ten Best Products of 1995.
7. Java Version History
JDK Alpha and 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 8 (18th March, 2014)
9. JDK,JRE, JVM
JVM
JVM (Java Virtual Machine) is an abstract machine. It is a specification that provides runtime environment in which java
bytecode can be executed.
The JVM performs following main tasks:
Loads code
Verifies code
Executes code
Provides runtime environment
JRE
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.
JDK
JDK is an acronym for Java Development Kit. It physically exists. It contains JRE + development tools.
10. class Simple{
public static void main(String args[]){
System.out.println("Hello Java");
}
}
JVM Architecture
12. OOPs (Object Oriented Programming System)
Object
Any entity that has state and behavior is known as an object. For example: chair, pen, table, keyboard, bike
etc. It can be physical and logical.
class
Collection of objects is called class. It is a logical entity.
Inheritance
When one object acquires all the properties and behaviors of parent object i.e. known as inheritance.
It provides code reusability. It is used to achieve runtime polymorphism.
Polymorphism
When one task is performed by different ways i.e. known as polymorphism. For example: to
convince the customer differently, to draw something e.g. shape or rectangle etc.
13. Abstraction
Hiding internal details and showing functionality is known as abstraction. For example: phone
call, we don't know the internal processing.
In java, we use abstract class and interface to achieve abstraction.
Encapsulation
Binding (or wrapping) code and data together into a single unit is known as encapsulation. For
example: capsule, it is wrapped with different medicines.