Introduction to Java Programming Language
Java is a programming language and a platform. Any hardware or software
environment in which a program runs, is known as a platform. Since Java has a
runtime environment (JRE) and API, it is called a platform.
Java is a high level, robust, object-oriented and secure programming language.
Java was developed by Sun Microsystems (which is now the subsidiary of Oracle) in
the year 1995.
James Gosling is known as the father of Java.
History of java
The history of Java starts with the Green Team. Java team members also known as
Green Team.
Team initiated this project to develop a language for digital devices such as set-top
boxes, televisions, etc. However, it was best suited for internet programming. Later,
Java technology was incorporated by Netscape.
The principles for creating Java programming were:
1. Simple
2. Robust
3. Portable
4. Platform-independent
5. Secured
6. High Performance
7. Multithreaded
8. Architecture Neutral
9. Object-Oriented
10. Interpreted, and Dynamic
Currently, Java is used in internet programming, mobile devices, games, e-business
solutions, etc.
Following are given significant points that describe the history of Java.
1. James Gosling, Mike Sheridan, and Patrick Naughton initiated the Java language
project in June 1991.
2. Initially it was designed for small, embedded systems in electronic appliances like set-
top boxes.
3. Firstly, it was called "Greentalk" by James Gosling, and the file extension was .gt.
4. After that, it was called Oak and was developed as a part of the Green project.
Oak is a symbol of strength and chosen as a national tree of many countries like the
U.S.A., France, Germany, Romania, etc.
5. In 1995, Oak was renamed as "Java" because it was already a trademark by Oak
Technologies.
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 than other names. Java
is an island in Indonesia where the first coffee was produced (called Java coffee). It is
a kind of espresso bean. Java name was chosen by James Gosling while having a cup
of coffee nearby his office. Notice that Java is just a name, not an acronym.
6. Initially developed by James Gosling at Sun Microsystems (which is now a subsidiary
of Oracle Corporation) and released in 1995.
Main Features of JAVA
1. Simple
Java language is a simple programming language because:
Java syntax is based on C++ (so easier for programmers to learn it after C++).
Java has removed many complicated and rarely-used features, for example, explicit
pointers, operator overloading, etc.
There is no need to remove unreferenced objects because there is an Automatic
Garbage Collection in Java.
2. Object-oriented
Java is an object-oriented programming language. Object-oriented means we organize our
software as a combination of different types of objects that incorporate both data and
behaviour. Basic concepts of OOPs are:
Object
Class
Inheritance
Polymorphism
Abstraction
Encapsulation
3. Platform Independent
Java is platform independent because it is different from other languages like C, C++,
etc. which are compiled into platform specific machines while Java is a write once,
run anywhere language. A platform is the hardware or software environment in which
a program runs.
There are two types of platforms software-based and hardware-based. Java provides a
software-based platform.
The Java platform differs from most other platforms in the sense that it is a software-
based platform that runs on top of other hardware-based platforms. It has two
components:
i. Runtime Environment
ii. API(Application Programming Interface)
Java code can be executed on multiple platforms, for example, Windows, Linux, Sun
Solaris, Mac/OS, etc. Java code is compiled by the compiler and converted into byte
code. This byte code is a platform-independent code because it can be run on multiple
platforms, i.e., Write Once and Run Anywhere (WORA).
4. Robust
Java is robust because:
o It uses strong memory management.
o There is a lack of pointers that avoids security problems.
o Java provides automatic garbage collection which runs on the Java Virtual
Machine to get rid of objects which are not being used by a Java application
anymore.
o There are exception handling and the type checking mechanism in Java. All
these points make Java robust.
5. Portable
Java is portable because it facilitates you to carry the Java bytecode to any platform. It
doesn't require any implementation.
6. Distributed
Java is distributed because it facilitates users to create distributed applications in Java.
RMI and EJB are used for creating distributed applications. This feature of Java
makes us able to access files by calling the methods from any machine on the internet.
7. Distributed
A thread is like a separate program, executing concurrently. We can write Java
programs that deal with many tasks at once by defining multiple threads. The main
advantage of multi-threading is that it doesn't occupy memory for each thread. It
shares a common memory area. Threads are important for multi-media, Web
applications, etc.
8. Dynamic
Java is a dynamic language. It supports the dynamic loading of classes. It means
classes are loaded on demand. It also supports functions from its native languages,
i.e., C and C++.Java supports dynamic compilation and automatic memory
management (garbage collection).