0% found this document useful (0 votes)
46 views10 pages

2 Java Intro and Features

Java was originally designed in the early 1990s by James Gosling at Sun Microsystems for use in cable television set-top boxes, but it was found to be suitable for general-purpose use on computers and servers. It is an object-oriented programming language that is designed to be simple, secure, portable, and robust. Some key features of Java include being platform independent, having a bytecode that can run on any Java Virtual Machine, automatic memory management, and strong support for object-oriented programming principles.

Uploaded by

adit.jain606
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
46 views10 pages

2 Java Intro and Features

Java was originally designed in the early 1990s by James Gosling at Sun Microsystems for use in cable television set-top boxes, but it was found to be suitable for general-purpose use on computers and servers. It is an object-oriented programming language that is designed to be simple, secure, portable, and robust. Some key features of Java include being platform independent, having a bytecode that can run on any Java Virtual Machine, automatic memory management, and strong support for object-oriented programming principles.

Uploaded by

adit.jain606
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 10

Introduction to Java

 Java is a computer programming language. It enables programmers to write computer


instructions using English based commands, instead of having to write in numeric codes.
 It’s known as a “high-level” language because it can be read and written easily by humans.
Like English, Java has a set of rules that determine how the instructions are written. These
rules are known as its “syntax”. Once a program has been written, the high-level
instructions are translated into numeric codes that computers can understand and execute.
 Java is an object-oriented programming language.
Java History
The history of Java is very interesting. Java was originally designed for interactive television, but
it was too advanced technology for the digital cable television industry at the time. The history of
java starts with Green Team. Java team members (also known as Green Team), initiated this
project to develop a language for digital devices such as set-top boxes, televisions, etc. However,
it was suited for internet programming. Later, Java technology was incorporated by Netscape.
The principles for creating Java programming were "Simple, Robust, Portable, Platform-
independent, Secured, High Performance, Multithreaded, Architecture Neutral, Object-Oriented,
Interpreted and Dynamic".
Currently, Java is used in internet programming, mobile devices, games, e-business solutions, etc.
There are given the significant points that describe the history of Java.

Object Oriented Programming (CSEG2016)


 James Gosling, Mike Sheridan, and Patrick Naughton initiated the Java language
project in June 1991. The small team of sun engineers called Green Team.
 Originally designed for small, embedded systems in electronic appliances like set-top
boxes.
 Firstly, it was called "Greentalk" by James Gosling, and file extension was .gt. After that,
it was called Oak and was developed as a part of the Green project.
 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.
 In 1995, Oak was renamed as "Java" because it was already a trademark by Oak
Technologies.
 Java is an island of Indonesia where first coffee was produced (called java coffee).
 Notice that Java is just a name, not an acronym.
 Initially developed by James Gosling at Sun Microsystems (which is now a subsidiary of
Oracle Corporation) and released in 1995.
 In 1995, Time magazine called Java one of the Ten Best Products of 1995.
 JDK 1.0 released in(January 23, 1996).

Many java versions have been released till now. The current stable release of Java is Java SE 10.
1. JDK Alpha and Beta (1995)
2. JDK 1.0 (23rd Jan 1996)
3. JDK 1.1 (19th Feb 1997)
4. J2SE 1.2 (8th Dec 1998)
5. J2SE 1.3 (8th May 2000)
6. J2SE 1.4 (6th Feb 2002)
7. J2SE 5.0 (30th Sep 2004)
8. Java SE 6 (11th Dec 2006)
9. Java SE 7 (28th July 2011)
10. Java SE 8 (18th March 2014)
11. Java SE 9 (21st Sep 2017)
12. Java SE 10 (20th March 2018)
13. Java SE 11 (September 2018)

Object Oriented Programming (CSEG2016)


14. Java SE 12 ( March 2019)
15. Java SE 13 (September 2019)
16. Java SE 14 (March 2020)

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:
1. Desktop Applications such as acrobat reader, media player, antivirus etc.
2. Web Applications such as irctc.co.in etc.
3. Enterprise Applications such as banking applications.
4. Mobile Application
5. Smart Card, Debit,Credit Cards
6. Robotics
7. Games
8. Television set-top boxes, Coffee Machine, Toaster machine, etc.

Types of Java Applications


There are mainly four types of applications that can be created using java programming:
1) Desktop Application
It is also known as desktop application or window-based application. An application that we need
to install on every machine such as media player, antivirus etc. AWT and Swing are used in java
for creating standalone applications.
2) Web Application
An application that runs on the server side and creates dynamic page, is called web application.
Currently, servlet, jsp, struts, jsf etc. technologies are used for creating web applications in java.
3) Enterprise Application
An application that is distributed in nature, such as banking applications etc. It has the advantage
of high level security, load balancing and clustering. In java, EJB is used for creating enterprise
applications.
4) Mobile Application

Object Oriented Programming (CSEG2016)


An application that is created for mobile devices. Currently Android and Java ME are used for
creating mobile applications.

Java Editions/Platforms
There are 4 platforms or editions of Java:
Java Standard Edition (JSE): The Java Standard Edition (Java SE) is for building desktop
applications and applets. These applications typically serve only a small number of users at one
time. It is a Java programming platform. It includes Java programming APIs such as java.lang,
java.io, java.net, java.util, java.sql, java.math etc. It includes core topics like OOPs, String, Regex,
Exception, Inner classes, Multithreading, I/O Stream, Networking, AWT, Swing, Reflection,
Collection, etc.
Java Enterprise Edition (JEE): It is an enterprise platform, which is mainly used to develop web
and enterprise applications. It is built on the top of the Java SE platform. It includes topics like
Servlet, JSP, Web Services, EJB, JPA, etc.
Java Micro Edition (JME): The Java Micro Edition is for applications used on mobile (e.g., cell
phone, PDA) and embedded devices (e.g., TV tuner box, printers).
JAVA Card: used in SIM Cards, ATM Cards, Credit Cards, SMART Card reader programming.

Object Oriented Programming (CSEG2016)


JAVA FEATURES
Java was designed with a few key principles in mind:
1. Simple:
 It resemble with C++.
 No need for header files like conio.h, iostream.h etc.
 No pointers, structures, union, operator overloading, virtual base class, friend function
etc.
 Size of basic interpreter and class support is about 40k bytes.
 The basic standard libraries and thread support adds an additional 175k bytes only.
 Java provides the bug free system due to the strong memory management.
 It also has the automatic memory allocation and deallocation system.
2. Object Oriented:
It support all the features of oops. Some of the important object oriented features are
namely:
 Class
 Object
 Inheritance
 Interfaces
 Packages
 Data Abstraction
 Data Encapsulation
 Polymorphism
 Overloading
 Reusability
3. Platform Independent or Architecture Neutral:
 The concept of Write-once-run-anywhere (WORA- known as the Platform independent) is
one of the important key feature of java language that makes java as the most powerful
language.
 The programs written on one platform can run on any platform provided the platform must
have the JVM.

Object Oriented Programming (CSEG2016)


 Java was written to be a portable language that does not care about the operating system or
the hardware of the computer.
 Size of primitive data types are machine independent.
 Example: int in Borland C++ takes 4 bytes and in Turbo C++ takes 2 bytes, but int in java
is always a 32 bits or 4 bytes integer.


4. Distributed:
 Java support many networking protocols like TCP, IP, HTTP, FTP, java has extensive
library for these protocols.
 Java application can open and access object across the internet via URL’s. Internet
programmers can call functions on these protocols and can get access the files from any
remote machine on the internet rather than writing codes on their local system.
 Java Support networking capabilities like socket connection, common gateway Interface
(CGI) scripting, Servlet, JSP, JSF- makes server side processing in java efficient.
 RMI enable communication between distributed objects.

5. Reliable and Robust:


 Java has the strong memory allocation and automatic garbage collection mechanism that
solve all the memory management problems.
 It provides the powerful exception handling which capture errors and eliminates any risk
of crashing.

Object Oriented Programming (CSEG2016)


 Provide compile time and run time checking -Compiler checks the program whether there
any error and interpreter checks any run time errors and makes the system secure from
crash.
6. Secure:
 Java does not support pointer like C/C++, Hence the memory locations of the system
cannot be accessed through a JAVA program, so any program developed in Java cannot
be used to hack a system.
 Java uses the public key encryption system to allow the java applications to transmit over
the internet in the secure encrypted form.
 The byte code Verifier checks the classes after loading.
 Java programs runs inside virtual machine, so Java is probably the most secure
programming language to date.

7. Portable:
 The feature Write-once-run-anywhere (WORA) means java compiler generates byte code
instruction that can be implemented on any machine. Java is portable because it facilitates
you to carry the Java bytecode to any platform. It doesn't require any implementation.
 Size of JAVAC and JAVA is approximate 200KB.

8. Compiled and Interpreted:

9. Popular:
 Java have rich libraries likes applets, servlets middlets etc that makes it popular.
 In C++ Library CustomizeApplication
 In Java Library Application

10. Multithreaded:
 Java language provides an environment by which several tasks can be initiated and
managed easily such feature is called multithreading.

Object Oriented Programming (CSEG2016)


Multithreading means a single program having different threads executing independently
at the same time.
 Multiple threads execute instructions according to the program code in a process or a
program.
 The main advantage of multi-threading is that it doesn't occupy memory for each thread.
It shares a common memory area.
 Example: In MS word program create different thread for different function like Save,
Scroll, Line Spacing, font size, auto save, spell check, delete, object insert etc.
 Multithreading works the similar way as multiple processes run on one computer.

11. Dynamic and Extensible:


 Java is a dynamic language. It supports dynamic loading of classes. It means classes are
loaded on demand.
 Java is capable in dynamic linking in new classes, libraries, methods and objects. Java
program support function written in other language such as c,c++.These functions are
known as native methods, this facility enables the programmers to use the efficient
functions available in these language, Native method are linked dynamically at runtime.

The team at Sun Microsystems was successful in combining these key principles, and Java's
popularity can be traced to it being a robust, secure, easy to use, and portable language.

Java Virtual Machine (JVM):


JVM (Java Virtual Machine) is an abstract machine. It is called a virtual machine because it doesn't
physically exist.
It is a specification provides runtime environment in which java bytecode can be executed.
JVMs are available for many hardware and software platforms.
JVM, JRE and JDK are platform dependent because configuration of each OS differs. But, Java is
platform independent.
The JVM performs following main tasks:

Object Oriented Programming (CSEG2016)


 Loads code
 Verifies code
 Executes code
 Provides runtime environment

Java Runtime Environment (JRE):


JRE is an acronym for Java Runtime Environment. It is also written as Java RTE. The Java
Runtime Environment is a set of software tools, which are used for developing Java applications.
It is used to provide the runtime environment. It is the implementation of JVM. It physically exists.
It contains a set of libraries + other files that JVM uses at runtime.
The implementation of JVM is also actively released by other companies besides Sun Micro
Systems.

JDK=JRE + Development Tools (JAVAC, JAVA)

Object Oriented Programming (CSEG2016)


Java Development Kit (JDK):
JDK is an acronym for Java Development Kit. The Java Development Kit (JDK) is a software
development environment, which is used to develop Java applications and applets. It physically
exists. It contains JRE + development tools.
JDK is an implementation of any one of the below given Java Platforms released by Oracle
Corporation:
o Standard Edition Java Platform
o Enterprise Edition Java Platform
o Micro Edition Java Platform
The JDK contains a private Java Virtual Machine (JVM) and a few other resources such as an
interpreter/loader (java), a compiler (javac), an archiver (jar), a documentation generator
(Javadoc), etc. to complete the development of a Java Application.
Example:
JDK 1.5,JDK 1.6 ,JDk 1.8
Note: The JRE is contained within the JDK (i.e., if you just download the JDK you will be able to
create and run java programs.).

Object Oriented Programming (CSEG2016)

You might also like