Core Java - SPLessons

Advantages of Java

Chapter 2

SPLessons 5 Steps, 3 Clicks
5 Steps - 3 Clicks

Advantages of Java

Advantages of Java

shape Description

Advantages of Java, As everyone know that Java has more features compared to other technologies as follows.


shape Conceptual
Figure

There are many advantages of Java.The following diagram shows features of Java.

shape Simple

Java is very simple to learn than C, C++ why because in Java pointers are not specified, pointers may lead to confusion, insecure.

shape Secure

Java is Object Oriented Programming Language and Java supports for Internet and Networking-based Applications which is more secured why because Java does not support pointers and multi threading.

Another reason is Bytecode is executed under JAVA Runtime Environment which has several Security related checkings. It is understandable by JVM only. Taking this feature into consideration,it is very difficult to trap the Internet and Network based Applications by the hackers.Java does not have pointer concept.


shape Portable

Java Bytecodes which are generated are secure and they can be run on any machine (portable) which has JVM.

shape Robust

Java is a strictly typed language. It checks code at compile time. Garbage collection, exception handling and many more features makes java robust.

shape Neutral

One of the main problems facing programmers is that no guarantee exists that if one writes a program today, it will run tomorrow even on the same machine.
The Java designers made several hard decisions in the Java language and the Java Virtual Machine in an attempt to alter this situation.So developers made it as write once and run anywhere.

shape Multithreaded

Java was designed to meet the real-world requirement of creating interactive, networked programs. Java bytecode was carefully designed so that it would be easy to translate directly into native machine code for very high performance by using a just-in-time compiler.To accomplish this, Java supports multithreading programming, which allows to write programs that do many things simultaneously.

shape Interpreted

Java supports cross-platform code through the use of Java bytecode. Bytecode can be interpreted on any platform by JVM.

shape Distributed

Java is designed for the distributed environment of the Internet because it handles TCP/IP protocols.

shape Dynamic

Java programs carry with them substantial amounts of run-time type information that is used to verify and resolve accesses to objects at run time.This makes it possible to dynamically link code in a safe and expedient manner.

shape Object-Oriented

Java programming is object-oriented programming language like C++, java provides most of the object oriented features as follows.
Inheritance: Inheritance in Java is the concept to hire the properties from base class.
Overriding: If subclass has the same method as declared in the parent class, it is known as method overriding in java.
Overloading : If a class has multiple methods having same name but different in parameters, it is known as Method Overloading.
Polymorphism :Polymorphism means one can perform a single action by various ways.

Platform – Independent

shape Description

Java compiler converts java file or source file(.java) to class file(.class) which is a bytecode. (.class file will be saved in \bin dir).Java Interpreter converts these byte codes to machine executable which can be run on any operating system.So, java is platform-independent as it follows write once and run anywhere.

shape Conceptual
figure

Why java is platform independent

Java is a platform independent programming language, Because when user install jdk software on system then automatically JVM are installed on system. For every operating system separate JVM is available which is capable to read the .class file or byte code. When user compileJava code then .class file is generated by javac compiler these codes are readable by JVM and every operating system have its own JVM so JVM is platform dependent but due to JVM java language is become platform independent.

Summary

shape Key Points

  • Advantages of Java includes the features as compared to other technologies.
  • JVM garbage collector will use mark and sweap algorithm to remove unused objects.
  • To improve high performance Java will use JIT(just in time compiler)
  • All the Java applications are run time applications.