Thursday 18 August 2016

Features of Java

1.3. Features / Buzzwords / Characteristics of Java

What are characteristics?
In this universe everything have  features / Characteristics.
Example: Lion
1. Strength 
2. Brave
3. Hunting   
4. Courageous 
5. King of the Jungle 

1. Java Characteristics are  
  • Simple
    • Secure
      • Robust
        • Portable
          • Dynamic
            • Distributed
          • Interpreted
        • Multi-threaded
      • Object-Oriented
    • Architectural-neutral
  • Platform Independent                               
1.Simple : 
     Syntactically Java is very easy to learn and Java programs are easy to write , compile and execute.In C++, the programmer need to take care about allocate and de-allocate the memory.In Java, Garbage collector will destroy the unused references.No pointer concept(from C language) & operator overloading concepts in Java.
2.Secure Robust :
          Security & Robust is one of the key features that makes Java most trustful to users, many reasons exists to why Java is a secure & Robust language, few of reasons from my bucket.

          Java has its internal mechanism for memory management.Exception Handling concept makes always normal termination of program execution.Order of program execution flow is well defined.

          Byte code is one of the most important thing which makes Java more secure.Garbage collection mechanism.Access control functionality.Java is strongly typed language and therefore strict compile time error checking for smooth execution of the program at run time.
3.Portable :
          Byte code is the key that makes Java language most secure and Portable.While compiling Java program then java compiler(javac) will generates the corresponding .class file of java program.This .class file contains byte code instructions.These byte code instructions are executed by JVM.
4.Dynamic :
          Java language was designed to work on different type of environments.classes will load dynamically if required.classes can instantiated dynamically.Based on requirement native libraries will load dynamically.
5. Distributed:
          Java is created for distributed environment of the Internet because if handles easily with TCP/IP protocols like HTTP and FTP.Because of this, making network connections much easier than in C or C++ languages.

6. Interpreted :
          In C/C++ the source code is converted to binary code by the compiler then this binary code can be executed by Operating System to get output.This binary code which is generated on one Operating System does not execute on other Operating System.I mean to say, the binary code generated on UNIX machine must be executed on UNIX only and similarly on the binary code generated on Windows machine must be executed on Windows only.For this reason, C/C++ are known as platform dependent languages.

          But coming to Java, the process is completely different and easily understandable.Java is platform independent language.Java got this platform independence because of two reasons that are,

◆  Compilation 
◆  Interpretation 

Compilation :
  • Converting Java source code to byte code is in known as compilation
  • Microprocessor of computer will not understand the byte code
  • Microprocessor of computer will understand only binary language.
Interpretation :
  • Converting byte code into machine understandable format is known as Interpretation.
  • Java uses Just In Time (JIT) compiler, which translates byte code into native code very efficiently.                                  
          Java supports multithread programming which a single Java program can have many different threads executing independently and continuously to finish the task.This makes very responsive to user input.

8. Object-Oriented :
               Java is object oriented language.The language which provides capabilities of OOPs features is called object oriented language.OOPs features are like data hiding, abstraction, encapsulation, inheritance, polymorphism etc.As a object oriented programmer you have to focus on the data in your application and method that manipulates that data.Strictly speaking that in object oriented system, a class is a collection of data and methods that operates that data.class will work with data and methods to describe the state and behavior of an object.

9.Architectural neutral:
          Java programs are compiled to an architecture neutral byte code format.As a application developer now a days in software industry, we may develop different type of applications which can run on all PCs, MACs, and UNIX as well as Windows.Once if we write Java program, however it can run on all platform.

10.Platform independent :
Platform = Hardware + Operating System (software)

               A platform means hardware and software, that work together to provide the capability of running programs.Examples are Personal Computers with Windows operating System & Linux operating system.Java language is platform independent but JVM is platform dependent.Java programs can run on any system for which a Java Virtual Machine has been installed.Simply i can say, Java got platform independence nature because of byte code.Compiler will generate these byte code instructions.JVM will converts byte code instructions into processor understandable format to produce the output.

A Fun Conversation:

One fine day a fun moments  happened between my friends Chandhu and Sravan(Sravan have no idea about Java)
Chandhu     : Why Java is platform independent language?
Sravan       : Java is platform independent language because of India?
Chandhu     : What !!! How can you say?
Sravan       : Dude, its very simple, because India is Independent country right.
Chandhu     : (Got shocked and drunk a glass of water) Sravan i ll not ask as Why Java is a Dynamic, you might be reply as you are young and dynamic.

Thanks for your time.

                                                        - Nireekshan