What is Java? Ordinary and Java Compilation ? (Java)

What is Java?

Java is nothing but a third generation object-oriented programming language with various features for writing programs or codes which include the concept of object and class. It helps the programmers to develop various software for solving different types of computational(meaning: related to computers) problems.

As simple language like English contains its own grammar to form words, sentences, and paragraphs, etc... Similarly, Java programming language also contains its own grammar(such as commands and statements) to write a program to solve any problem . The programmer sequenced these commands, statements and functions according to type of problems. This programming language makes the concepts easier and understandable. 

Before going into the details of Java environment, let us understand about Objects and Class...

What is Object?

The Object is an entity. For example: a pen, a place, a mouse, a table, a chair, a customer or data etc..., are objects.

Definition: An identifiable entity with some characteristics(or data), a state and behaviour (or function) is known as Object.

Objects are the fundamental units of object-oriented programming.The object is an important component of a program that knows how to perform certain actions and how to interact with other elements of the program.

Every Object has the following in-built characteristics:

1) Identity: The name by which an object is recognised is known as identity. EXAMPLE : Pen, laptop, computer, CD, box, etc..

2) State: It refers to wheather an object is in processed or unprocessed. EXAMPLE: a laptop or a computer may be in any of the following states:
(i) On State
(ii) Off State
(iii) Out of order state

3) Behaviour: This refers that what an object is capable of doing?

For Example: Bike is an object. Its characteristics are: Its colour is Black, Its engine is of 150cc, Its company is Bajaj and identified by its name "Bajaj Discover 150". Its behaviour is to starting the engine, changing the gear, using the break, etc... At a particular time , it may be in ON state, at another time, it may be in OFF state or OUT OF ORDER state.

What is Class?

A class is a collection of objects of similar type or a class is a blueprint of an object.

Definition: A class is a collection of objects of similar type.

Now, we are going back to our previous topic about Java...

Before going to study any further details about Java let us know the History of Java.

History of Java:

James Gosling wrote Java Programming Language along with two other person Mike Sheridan and Patrick Naughton, while they were working at Sun Microsystems, Inc.

Java was developed by name 'Oak' and renamed as 'Java' in 1995.

The main objective of development of the Java programming language was to develop software for consumer electronic devices like TVs, VCRs, toasters, microwave, remote controls, etc... The existing programming language had limitations in terms of both portability(means I can run the programs developed in the language on any platform and platform refers to computer system including accessories and operating system) and reliability. To develop the programming language, the team headed by James Gosling began to work on this project to develop a programming language with all the required features, and created the language name as Java.

Types of Java Program:

The sequence of instructions of any programming language used to find the solution of a problem is known as a Program.

A Java program is composed of data members /variables and methods/functions.

The Java program is commonly divided into 2 categories:

  1. Applet Program: The program written in the Java programming language that can be included in an HTML page is known as applet program.
  2. Application  Program Interface (API) or Application Program: The stand alone Java program that runs as a true application without a browser using JVM is known as application program interface (API) or application program.

The thing which makes Java Programming Language unique from all other programming language is the platform independency of platform.

Let us understand what is platform-independency of Java.

Like all other programming language, if we write a program for a particular platform in other programming language then the program will work in only that particular platform not in any other platform, But Java solves the problem of platform-independence by using byte code.

For example: a Windows program will not be able to run on a computer that only runs DOS; A Mac application can't run on Unix workstation, and so on.

Let us study in detail about how Java compilation process and orinary compilation process work:
 
Ordinary Compilation Process:

The program or code written by a programmer is usually called the Source Code. This source code needs to be converted into machine language code, which computer can easily understand. The process of converting a source code into machine code, is called compilation. The converted machine code depends a lot on the platform it is executing upon. That means for different platforms different machine code id produce. This resultant machine code is called native executable code.

Which means to run a same program written on one platform and if we want to run on another platform then we need to write the same program on another platform.

Java Compilation Processs:

Contrary(meaning: completely different; opposite) to ordinary compilers, the Java compiler does not produce native executable code for a particular machine. Instead it produces a special format called byte code.

Java compiler is javac - a program that compiles Java source code (Java programs) into compiled byte code.

Again now source code is to be written by programmer. Now the Java compiler will compile the source code into byte code rather than machine language.

Now this byte code is not understand by the computer, as computer understand only machine language, so this byte code is understanded by Java Vistual Machine (JVM), which can run on any platform.

Which means to run a same program written on one platform and if we want to run on another platform then we do not need to write the same program on another platform if we are using Java programming language.

So, the platform independence of Java which makes it different from any other programming language.
Here is image which will make you understand the difference between Ordinary Compilation Process and Java Compilation Process:

Features or Characteristics Of Java:

Being a very powerful programming language. Some of its features or characteristics are as follows:
  • Platform Independent : It is a platform independent language which means the change of environment or platform, the Java program will not be affected.
  • Write Once Run Anywhere (WORA) : It means the program written in Java can be successfully executed in other platform without any change.
  • Object Oriented Language : It supports OOP concept i.e. Data Abstraction, Encapsulation, Inheritance and Polymorphism which enables easier and convenient program development.
  • Simple Coding : The Java coding is simple which does not require complex innstructions.
  • User Friendly Environment : It can also be used by the novice user with fundamental programming concept.
  • Java is Robust : The Java has feature of automatic memory management and garbage collection along with strong exception handling (or checking) mechanism that makes it Java Robust.
  • Secure Environment : The Java language supports many strong in-built security features that makes the system secure from crash.
So that is it for the Java Programming Language. Hope you find it useful and if you have any query do comment in the comment box and i will try to solve your query.

Thank You.
What is Java? Ordinary and Java Compilation ? (Java) What is Java? Ordinary and Java Compilation ? (Java) Reviewed by Get2Know on August 29, 2020 Rating: 5

No comments:

Business

Powered by Blogger.