Best Features of JAVA:
Java is completely object oriented. C++, being more compatible to C, allows code to exist outside classes too. However in Java, every line of code has to belong to some or other class. Thus it is closer to true object oriented language. Java is simpler than C++, since concepts of pointers or multiple inheritance do not exist.
Let us discuss these features in detail that’s make JAVA a popular programming Language,
To stay abreast of modern software development practices, Java is Object-Oriented from the ground up. Many of Java’s Object-Oriented concepts are inherited from C++, the language on which it is based, plus concepts from other Object-Oriented languages as well.
Java omits many confusing, rarely used features of C++. There is no pointer level programming or pointer arithmetic. Memory management is automatic. There are no header files, structures, unions, operator overloading, virtual base classes, and multiple inheritance.
Java programs are reliable. Java puts a lot of emphasis on early checking for
potential problems, dynamic checking and eliminating situations that are error-prone.
Java is intended to be used in networked / distributed environments. Thus a lot of emphasis is placed on security. Normally two things affect security:
• confidential information may be compromised, and
• computer systems are vulnerable to corruption or destruction by hackers.
Java’s security model has three primary components:
• Byte code Verifier, Class Loader and Security Manager.
This refers to a program’s capability of moving easily from one computer system to another. Java is platform-independent at the binary level.
- Java binary files are also platform-independent and can run on multiple platforms without the need to recompile the source because they are in the form of byte codes.
Interpreted and Compiled:
Java programs are compiled into an intermediate byte code format, which in turn will be interpreted by the JVM at run time. Hence, any Java program is checked twice before it actually runs.
JVM: It interpret the Java compiled file. The Java designers made several hard decisions in the Java language and the Java Virtual Machine (JVM) in an attempt to alter this situation. Their goal was “write once; run anywhere, any time, forever”. To a great extent, this goal was accomplished.
A multi-threaded application can have several threads of execution running
independently and simultaneously. These threads may communicate and cooperate. To the user it will appear to be a single program. Java implements
multithreading through a part of its class library. However, Java also has language constructs to make programs thread-safe. [Remember: Threading is different from Process ]
Java manages memory de-allocation by using garbage collection. Temporary memory is automatically reclaimed after it is no longer referenced by any active part of the program.