Features of java

In this topic, you will learn about, Features of java.

Following are the features of Java:

  1. Compiled and Interpreted: Java language used both compiler as well as interpreter. This makes JAVA a two-stage system. The First Java compiler translates the source code into what is known as BYTECODE.BYTECODE are not machine instructions. In the second stage, java interpreter generates the machine code using this BYTECODE that can be executed by the machine running the JAVA program.
  2. Simple: Java is very easy to learn, and its syntax is simple, clean, and
    easy to understand. According to Sun, Java language is a simple
    programming language because:

    • Java syntax is based on C++ (so easier for programmers to learn it after C++).
    • Java has removed many complicated and rarely-used features, for example, explicit pointers, operator overloading, etc.
    • There is no need to remove unreferenced objects because there is an Automatic Garbage Collection in Java.
  3. Object-oriented: Java is an object-oriented programming language. Everything in Java is an object. Object-oriented means we organize our software as a combination of different types of objects that incorporate both data and behavior.
        1. Object-oriented programming (OOPs) is a methodology that simplifies software development and maintenance by providing some rules. Basic concepts of OOPs are:
          1. Object
          2. Class
          3. Abstraction
          4. Encapsulation
          5. Inheritance
          6. Polymorphism
  4. Platform Independent: Platform is a combination of processor and OS(operating
    system). Java is plate form independent language. It can run on any platform. Changes and upgrades in operating systems, processors, and system resources will not force any change in the Java program.
  5. Secured: Java is best known for its security. With Java, we can develop virus-free systems. Java is secured because it provides many built-in security features such as no explicit pointer and bytecode verifier.
  6. Robust: Robust simply means strong. Java is robust because:
    • It uses strong memory management.
    • There is a lack of pointers that avoids security problems.
    • There is automatic garbage collection in java which runs on the Java Virtual Machine to get rid of objects which are not being used by a Java application anymore.
    • There are exception handling and the type checking mechanism in Java.
      All these points make Java robust.
  7. Architecture-neutral: Java is architecture-neutral because there are no
    implementation-dependent features, for example, the size of primitive types is fixed.
    In C programming, int data type occupies 2 bytes of memory for 32-bit architecture and 4 bytes of memory for 64-bit architecture. However, it occupies 4 bytes of memory for both 32 and 64-bit architectures in Java.
  8. Portable: Java is portable because it facilitates you to carry the Java bytecode to any platform. It doesn’t require any implementation.
  9. High-performance: Java is faster than other traditional interpreted programming languages because Java bytecode is “close” to native code(machine code). It is still a little bit slower than a compiled language (e.g., C++).
  10. Distributed: Java is distributed because it facilitates users to create distributed applications in Java. RMI and EJB are used for creating distributed applications. RMI stands for Remote Method Invocation. It is a mechanism that allows an object residing in one system (JVM) to access/invoke an object running on another JVM.RMI is used to build distributed applications; it provides remote communication between Java programs. develop scalable, robust, and secured enterprise applications in java. Unlike RMI, EJB ( Enterprise Java Bean) is used to provides middleware services such as security, transaction management, etc. to all EJB applications. This feature of Java makes us able to access files by calling the methods from any machine on the internet.
  11. Dynamic: Java is a dynamic language. It supports dynamic loading of classes. It means classes are loaded on demand. It also supports functions from other languages such as C and C++. These Functions are known as Native Methods. Java also supports automatic memory management (garbage collection).
  12. Multi-threading: JAVA support multi-threading. In java, multi-threaded programs can be created. Multi-threaded means handling multiple tasks simultaneously.
See also  Java Program find out the number of vowels in a string