Features of Java
Below are some important features of Java language:
- Object Oriented
- Platform Independence
- Architecture Neutral
- High Performance
Java was developed to be easy for the programmer to use it effectively. If you have some programming experience of object oriented programming you can easily understand Java. It’s syntax is similar to C++ language so programmer have little trouble to understand it and also the confusing concepts of C++ like Pointer and Operator Overloading are not in Java. In Java there is also no need to worry for the unreferenced objects as there is Automatic Garbage collection in Java.
Java is a secure programming language because of many reasons like it does not support pointers explicitly and uses its own run time environment and also JVM verify the bytecode before it is run. We will later discuss on JVM and bytecode. JVM also reduce the memory safety issues to developer. Last but not least, Java libraries has many security related API’s for ex. Cryptographic algorithms, authentication protocols etc.
3. Object Oriented
Java is an object oriented programming language which construct the program or application by using Object and its behaviour. These objects are unique and also instances of classes which supports encapsulation, inheritance and polymorphism.
Java is a robust language due to below features:
- Portable across multiple OS
- Strong memory management
- Strong type checking
- Automatic garbage collection
- Good exception handling framework
5. Platform Independence
Java is a platform independent which is based on the concept WORA(write once run anywhere). It means a Java program which compile on window can run on other OS(Mac, window or linux).
Java is a portable language because code written in Java can execute all the major OS. After compiling Java code(bytecode or .class), these files can also run on Java supported platform without any modification(i.e., 32-bit vs 64-bit environments).
Compiler is basically converted source code to byte code. Microprocessor does not understand the byte code language it only understand the machine or binary language. Interpreter is convert this bytecode into readable machine code by processor. The Window’s Java interpreter is different from Linux interpreter so we must load OS compatible java interpreter. For different operating systems we have different JDK’s and interpreter is the part of this JDK.
8. Architecture Neutral
Java application can run anywhere on the operating systems or networks. Java compiler generates an architectural neutral code(bytecode or .class) which can execute on many processors with the help of their corresponding interpreter. For instance in C language, the data type occupies different space in memory for 32 and 64-bit processor architecture while in Java, it occupies same size for both 32 and 64-bit processor.
Java is a multithreaded programming language which means it can have different threads executing concurrently. Multithreading is different from multitasking, in multitasking we share our resources among multiple processes while in multithreading we share our resources among threads of a single process.
Java is called dynamic language due to below features:
- Because of bytecode, as it can be executed at run time on any platform.
- Provide dynamic memory allocation.
- Also support dynamic binding.
Java is a distributed language because the Java program compiled into one machine but can execute on another machine with the help of byte codes facility. Also in Java we have RMI and enterprise Java beans concept through which we can create dynamic application which create on local machine and run on the networks.
12. High Performance
Java enables high performance with the help of Just-In_Time compiler. It compiles the bytecode into platform specific executable code that is executed immediately. A JIT is used with interpreted code to convert it to machine language but purely interpreted code without JIT is slow.