Features of java
The main objective of Java Programming language creation was to make it portable, simple and secure programming language.
The following features of Java language are-
Simple
- Java is easy to learn and its syntax is quite simple, clean and easy to understand.
- Java derives its syntax from C and object-oriented features from C++.
- Java has removed many confusing and rarely-used features e.g. explicit pointers, operator overloading etc
- There is no need to remove unreferenced objects because there is Automatic Garbage Collection in java.
Object-oriented
- Java is 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 incorporates both data and behaviour.
- Java can be easily extended as it is based on Object Model.
Basic concepts of OOPs are:
- Object
- Class
- Inheritance
- Polymorphism
- Abstraction
- Encapsulation
Platform Independent
- Java is platform independent because it is different from other languages like C, C++ etc. which are compiled into platform specific machines while Java is a write once, run anywhere language.
- A platform is the hardware or software environment in which a program runs.
- There are two types of platforms software-based and hardware-based. Java provides software-based platform.
- The Java platform differs from most other platforms in the sense that it is a software-based platform that runs on the top of other hardware-based platforms. It has two components
- Runtime Environment
- API(Application Programming Interface)
Secured
- When it comes to security, Java is always the first choice. With java secure features it enable us to develop virus free, temper free system.
- Java program always runs in Java runtime environment with almost null interaction with system OS, hence it is more secure.
- Java is best known for its security. With Java, we can develop virus-free systems. Java is secured because:
- No explicit pointer
- Java Programs run inside virtual machine sandbox
Robust
- Java makes an effort to eliminate error prone codes by emphasizing mainly on compile time error checking and runtime checking
- It uses strong memory management.
- There are 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 is exception handling and type checking mechanism in java.
Architecture-neutral
- Compiler generates bytecodes, which have nothing to do with a particular computer architecture, hence a Java program is easy to intrepret on any machine.
Portable
- Java Byte code can be carried to any platform. No implementation dependent features. Everything related to storage is predefined, example: size of primitive data types
High-performance
- Java is an interpreted language, so it will never be as fast as a compiled language like C or C++. But, Java enables high performance with the use of just-in-time compiler.
Distributed
- Java is distributed because it facilitates users to create distributed applications in java.
- RMI and EJB are used for creating distributed applications. This feature of Java makes us able to access files by calling the methods from any machine on the internet.
Multi-threaded
- Java multithreading feature makes it possible to write program that can do many tasks simultaneously.
- Benefit of multithreading is that it utilizes same memory and other resources to execute multiple threads at the same time, like While typing, grammatical errors are checked along.
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.