Advantages of Java
Java was designed by the professionals for the professionals. There are many advantages of Java. The most important advantages are given below:
The syntax is very easy and anyone who has ever written a program should be able to comprehend a java program very easily. Basic Understanding of OOPS concepts would help you a lot. C++ programmers would feel right at home. Infact, the similarity of Java to C++ was one of the biggest reason for Java's explosive popularity.
Java is a secure programming pltform. All the Java programs are executed by the Java Virtual Machine inside a sandbox hence it is difficult to affect the underlying Operating System. Ofcourse, Nothing is completely secure.
3. Object Oriented
Well!! This is the interesting part. Java is STRICTLY Object Oriented. You can not write even a single program that is not Object Oriented as some level. Like all Object Oriented programming Languages the main focus of Java is not the Data and not the procedure.
Everything in Java revolves around Object i.e. Data.
The programs written in Java are robust. Since the program has to run on diverse platforms, the code has to be strictly checked so that undesirable conditions are minimized after deployment. To achieve this Robustness, Java programs are checked at Compile Time which catches all the basic syntax erros, unreachable code etc. and then the code is checked at Runtime too for exceptions that are throws at Run-Time , appropriate Error Messages are printed on console to exactly pin point the Error. Two most important features the make Java Porgrams Robust are:
- Memory Management : Memory Leakage is the biggest problem that C and C++ developers face since they have to manually allocate and free dynamically allocated memory (malloc,calloc,free). It causes problems when the programmer forgets to delete an allocated memory or tries to free the memory being used by another piece of code. Java has an inbuilt Garbage Collector which automatically collects the unused memory.
- Run Time Exceptions : Java provides exception handling to handle Run Time exceptions like Divide By Zero, File Not Found etc.
The Goal of Java was "Write Once , Run Anywhere !"
Portability was the main reason behind the development of Java Programming language. A program written on one platform is converted into bytecodes which can be nterpreted by the JVM on any platform.
To implement portability a specific JVM is made for each platform which can convert the generic bytecode in to the language that the machine can understand.
Java supports multi threading which allows a Java program to do multiple things simultaneously. This feature is very important for interactive applications and Networked Programs.
An Example where we can make use of multi-threading is "To poll multiple systems in a network for their OS versions".
7. High Performance
The Java bytecode was designed very carefully so that the programs can be directly interpreted/converted into Native Machince code by using Just-In-TIme Compiler for high performance.
Java handles TCP/IP protocols and hence can be used for developing Distributed Systems. It also suppots Remote Method Invocation (RMI) thorough which we can invoke methods across networks.
There are many more advantages of Java which you will experience when you start using Java as your choice of programming Language.