Features of Java
Features of Java
1. Simple
Java is a very simple programming language, it is easy to learn, read and write in Java. The
syntax of Java is clean and easy to understand.
Here’s why java is simple programming language compared to other popular programming
language:
2. Platform Independent
Java is a platform independent language. Compiler(javac) converts source code (.java file) to
the byte code(.class file). JVM executes the bytecode produced by compiler. This byte code
can run on any platform such as Windows, Linux, Mac OS etc. Which means a program that
is compiled on windows can run on Linux and vice-versa.
Each operating system has different JVM, however the output they produce after execution of
bytecode is same across all operating systems. That is why we call java as platform
independent language.
3. Secure
We don’t have pointers and we cannot access out of bound arrays (you get
ArrayIndexOutOfBoundsException if you try to do so) in java. That’s why several security
flaws like stack corruption or buffer overflow is impossible to exploit in Java.
1. Abstraction
2. Encapsulation
3. Inheritance
4. Polymorphism
5. Robust
Robust means reliable. Java programming language is developed in a way that puts a lot of
emphasis on early checking for possible errors, that’s why java compiler is able to detect
errors that are not easy to detect in other programming languages.
1. Garbage collection,
2. Exception Handling
3. Memory allocation.
6. Distributed
In simple words: The java programs can be distributed on more than one systems that are
connected to each other using internet connection. Objects on one JVM (java virtual
machine) can execute procedures on a remote JVM.
7. Multithreading
8. Portable
As discussed above, java code that is written on one machine can run on another machine.
The platform independent byte code can be carried to any platform for execution that makes
java code portable.
9. Architectural Neutral
As we know Java is a platform independent language, which means program written and
compiled on one machine can run on any other machine having different operating system.
Java follows the principle of “Write once run anywhere“
Compiler converts the java file into byte-code and this byte code is machine independent,
java virtual machine can easily translate this byte code into machine specific code. This
makes java architectural neutral programming language.
10. Dynamic
Java is a dynamic programming language. OOPs allows developers to add new classes to the
existing packages, add new methods to the existing classes as well as modifying the method
without changing the original method code by using the concept of method overriding.
All these features make java dynamic. It also allows classes to be loaded on demand. It also
supports functions from its native languages such as C and C++.
12. Performance
Also java uses the concept of multithreading, which allows concurrent execution of several
parts of the code at the same time. This provides high performance.
It is still a little bit slower than a compiled language (e.g., C++). Java is an interpreted
language that is why it is slower than compiled languages, e.g., C, C++, etc.