What is Java?

Java is the object oriented programming language and much similar to C++. The programming language like C and C++ are platform dependent where java is the platform independent (works by WORA - Write Once Run Anywhere). This is the major advantage that makes the programming language like java came into existence.

" Operating System (OS) + Processor = Platform
Before we starts to learn about the java programming it is very important to known what is the drawbacks in other programming language (like C and C++) that makes java come into existence "

C and C++

It is one of the most powerful object oriented programming language. It works by WOCA (Write Once Compile Anywhere) i.e.., Platform dependent language. The working process of C++ are shown in the fig 1.0
fig 1.0

The above gives the brief explanation about the compilation of C and C++. which we should be take into consideration before we start learn the java programming language.

The compilation process are explained as follows:
Stage 1 : The Preprocessor copies the content of the header in the source code and generated to macro code.
Stage 2: This expanded Source code is then compile using compiler which generates the assembly language for that platform.
Stage 3: The assembler code is then assembled into the Object code for that platform using Assembler.
Stage 4: The linker is used to add the required library for the Object Code to produce an executable code.

This show that C/C++ language compiled depending on the platform. which is known as platform dependent

Java

It is simple and object orientated programming language. Unlike C/C++ it is platform independent language which works by WORA (Write Once Run Anywhere). Hence, it is used for many different software programs, games and add-ons. The working process of java are shown in the fig 1.1
what is java,java,learn java,java (programming language),what is java used for,java programming,java (software),java tutorial,what is java?,learning java,java programming tutorial,what is a java class?,what is spring in java,what is a class in java,what,java what is a class,what is map and hashmap in java,java programming language,what is spring framework in java,java tutorial for beginners
fig 1.1

The above diagram show the stages involved while we execute the java program. The brief explanation of these stages are discussed below:

Stage 1: The Java source code is saved the extension of .java . For example: Sample.java
Stage 2: The source code is compile using the java compiler which will generate the intermediate code which is popularly known as byte-code with the extension of .class .
Stage 3: The byte-code is passed to the JVM (Java Virtual Machine) which has interpreter that reads the each and every statement one by one and converts that to executable code of that platform.

What is the difference between Compiler and interpreter?
Compiler: It will convert entire Source code into intermediate code that it can be executed
Interpreter: It will reads Source code one-by-one, converts it into virtual machine code and then it will be executed"


Features of  Java:
  1. Simple
  2. Object Oriented
  3. Platform independent
  4. Secured
  5. Robust
  6. Architectural neutral
  7. Portable
  8. High Performance
  9. Multi Threaded
  10. Distributed
  11. Interpreted
Simple:
Java is very simple and easy to learn programming language. Which much more similar to C++.
It is simple because non-referenced objects are removed automatically by GC (Garbage Collector).

Object Oriented:
Everything in java are as an object which has own set of data and behavior. The core oops(Object oriented programming language ) are:
  1. Class
  2. Object
  3. Inheritance
  4. Polymorphism
  5. Abstraction
  6. Encapsulation
Platform independent:
It is one of the unique feature that make java more popular. Unlike other programming language like C++, we can write and compile the programming in one platform and can able to run that compiled program to any platform which supports JVM. Because the JVM has a interpreter which produce the executable code based on the platform.

Secured:
When comes to security java will be the first choice for all developer because unlike other programming languages, Java will not interact with OS (Operating System) to run the program. Some of the other points that shows the java is more secured languages are as follows:

  • It has no explicit pointer
  • It run in separate virtual machine sandbox
  • It adds the class loader which separate the classes for the package of the local file from imported ones of the network
  • It has the byte-code verifier which eliminates the  illegal code that violate the access
Robust:
It is robust language because it has exception handling, garbage collector, lack of pointer that avoids security issues and also some checking process before executing.

"Meaning:
Robust = Strong and healthy" 

Architectural neutral:
It is because there is no implementation dependencies which means that it occupy the 4-byte for both 32 bit and 64 bit architecture. In other words, the compiler generates the byte-code, which nothing to do with a particular computer architecture. Hence, java is an architectural neutral which can be interpreted on any platform.

Portable:
Because the java compiler generates the byte-code which is not depended on the computer architecture. Therefore, the byte-code can be carry to any platform and run the program which has a JVM.

High Performance:
Java is an interpreted language, it offers the high performance due to byte-code which is very near to native machine code. It is very faster than any other interpreted language

"Java enables the Just-in-time compiler (JIT Compiler) present inside the JVM which helps improve the performance"

Multi Threaded:
Instead of creating the separate memory allocation for each any every task to process simultaneously.
Java allows the user to create the Multi-Threading concept in one program which will run/execute the task simultaneously in one memory. 
For example: checking spelling mistake while typing

Distributed:
Java can create distributed application using RMI and EJB. We may access files by calling the methods from any machine on the internet.

Interpreted:
An interpreter in java is needed to run the java programs. The java compiler generate the byte-code which is machine-independent. This byte-code can be run on any computer which has a JVM interpreter.



"If you have any queries or questions. Please comment below"

Comments

  1. Sir I like your post.I am interested in it.I want to get such information.Carry it on.Thanks

    ReplyDelete

Post a Comment

Popular posts from this blog

PHP Login and Registration script

Multiple image upload to database and display from it

Java program to display diamond pattern