What is Java?


Java is a high level programming language that is considered as the object oriented programming language. Java is called a platform because it has its own runtime environment and a platform is known as any software or hardware in which we can run a program. Java was designed to be small, simple, and portable across platforms and operating systems. Java was modeled after C++. Java was written as a full-fledged programming language.

Java was originally developed by Sun Microsystems, a company best known for its high-end UNIX workstations in 1991. Java is an efficient, fast and easily portable programming language. Java is considered to be an ideal language for distributing executable programs through World Wide Web. Java is also considered as the general purpose language for developing programs, these programs are easily usable and portable across different platforms.


Example of Java:

Consider the following example in which the first program in Java is demonstrated:


public class MyFirstProgram {

public static void main (String args[]){

       System.out.println(“My First Program in Java”);




Why Learn Java?

Java is learned because the applets for the World Wide Web are written in Java and this must be the most compelling reason to learn Java. Java as the programming language has many advantages on other programming languages. The following are some of the advantages of Java:


Platform Independent:

Platform independence is considered to be one of the most significant advantages that Java has over other programming languages. Platform independence means that a program written in one computer can be moved to the other computer. As Java is an object oriented programming therefore, the classes in Java makes the code easy to write hence we can easily transfer our source code from one platform to another platform.

In Java the binary files are also platform independent. This means that they can be run on a number of platforms without recompiling the source code. The binary files of Java are in a form of byte codes. Byte codes are a set of instructions that looks like a machine code.

 A Java development environment has two parts that is a Java compiler and a Java interpreter. The compiler of Java takes the Java program and then generates byte codes. In other programming languages such as C, C++, the compiler takes the program and then generates a machine code. But this is not with the Java compiler.

A Java program is then run by the Java interpreter and to run the program in Java the byte code interpreter is run.

A Java program is in byte code form. It means that the program is not run only in one system but can be run on other systems or platforms or any other operating system such as window. This can only be done as long as the Java interpreter is available.

The disadvantage of using the byte code is that the speed of execution becomes slow sometimes. This is mainly because the specific programs of the system are run directly on that hardware on which they are compiled and these types of programs run more faster than Java byte code, because the byte codes are mandatory to be processed by the interpreter.


Java is Object Oriented programming language:

Object oriented programming is a technique through which the programs are organized. The program becomes more flexible. A modular program is obtained when using the object oriented programming. By modular programs we mean the programs that are divided into small modules or functions. The Java’s object oriented programming concepts are mainly inherited from C++ programming language. Java like the other object oriented programming languages has classes and libraries. These provide basic data types and input and output functions and other utility functions. The Java development kit has classes that support networking, internet protocols and user interface functions. As these classes are defined in Java therefore, they are portable and can be used on other platforms.


Java is easy to learn:

Java is easy to learn programming language because Java was developed to be the simplest programming language. The programs in Java are easy to write and understand, compile, and debug and hence easy to learn programming language. Java on the other hand is also flexible and powerful programming language. Many of the syntax of Java are inherited from C++ programming language because it was developed after C and C++. The C++ programming language is the base of Java programming. Therefore, we can learn java easily.

The complex parts of C and C++ are excluded from Java which makes the programming language easy to learn. In Java there is no concept of pointers and the strings and arrays are considered as the real objects in this programming language.


Where Java is used?

Java is used in more than three million devices. Java is used on the following devices:

  1. In media players, acrobat reader and other desktop applications.
  2. Java is widely used in mobile phones.
  3. Java is used in games, robotics, embedded systems etc.


Types of Java Applications:

There are four types of applications in Java:

Standalone Application:

The standalone application can also be considered to be the desktop application or a window based application. The stand alone applications can be run on any machine. But this machine should have installed the Java run time system.

Web application:

A web application is that in which a client can run a web browser. The web application runs on the server side. We use the Java web applications to create dynamic websites. The technologies Servlets and JSPs are used for the web applications in Java. The Java web application is needed when we want our information to be dynamic. The simple website can be created by using the static HTML pages.

Enterprise Application:

An enterprise application is considered to be as the business application such as banking applications. The technology EJB is used in Java for creating the enterprise applications in Java. The enterprise applications are user friendly and have an advantage of high security.

Mobile Application:

There are various applications in Java that are created for mobile devices such as android; browser based mobile apps and IOS, etc.