Tuesday, October 26, 2021

Features of JAVA

1. 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. A program that is compiled on windows can run on Linux and vice-versa. 

Every operating system has different JVM, but the output they produce after execution of bytecode is same across all operating systems. That is why we call java as platform independent language.

2. Java is an Object Oriented language

Object oriented programming is a way of organizing programs as collection of objects, each of which represents an instance of a class.

Four main concepts of Object Oriented programming are:

a. Abstraction

b. Encapsulation

c. Inheritance

d. Polymorphism

3. Simple

Java is considered as one of simple language because it does not have complex features like Operator overloading, Multiple inheritance, pointers and Explicit memory allocation.

4. Compiled and interpreted

Usually, a computer language can be either compiled or interpreted. Java integrates the power of Compiled Languages with the flexibility of Interpreted Languages.

Java compiler (javac) compiles the java source code into the bytecode.

Java Virtual Machine (JVM) then executes this bytecode which is executable on many operating systems and is portable.

5. Robust Language

Robust means reliable. Java is robust as it is capable of handling run-time errors, supports automatic garbage collection and exception handling, and avoids explicit pointer concept.

Java has a strong memory management system. It helps in eliminating errors as it checks the code during both compile and runtime.

Java is garbage-collected language – JVM automatically deallocates the memory blocks and programmers do not have to worry about deleting the memory manually as in case of C/C++.

Java also provides the concept of exception handling which identifies runtime errors and eliminates them.

In Java, any runtime error encountered by the JVM is never passed directly to the underlying system rather immediately terminates the program stopping it from causing any harm to the underlying
system.

6. Secure

Security is an important issue for any programming language as there is a threat of malicious activities and viruses. Java supports access modifiers to check memory access and also ensures that no viruses enter an applet.

Java is a more secure language as compared to C/C++, as it does not allow a programmer to explicitly create pointers. Thus in Java, we cannot gain access to a particular variable if we do not initialize it
properly. 

7. Java is distributed

Using java programming language we can create distributed applications. RMI(Remote Method Invocation) and EJB(Enterprise Java Beans) are used for creating distributed applications in java.

The java programs can be distributed on more than ne systems that are connected to each other using internet connection. Objects on one JVM (java virtual machine) can execute procedures on a remote JVM.

8. Multithreading

Java supports multithreading. Multithreading is a Java feature that allows concurrent execution of two or more parts of a program for maximum utilisation of CPU.

9. Portable

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.

0 comments:

Post a Comment

Data Structures with C++



NET/SET/CS PG



Operating Systems



Computer Networks



JAVA



Design and Analysis of Algorithms



Programming in C++

Top