Features of Java
Java is featured by plenty of terms which are also known as “Java Buzzwords” and are simple & easy to understand by heart. The all features of Java language are so appropriate and interesting that they all are worthy in its succession. Those features which made Java as one of the most popular languages are as following:
Let’s consider each feature (term) separately and understand it clearly.
As defined by Sun Microsystems, Java is simple language because it does not some potentially confusing features such as multiple-inheritance, pointers, operator overloading, and explicit memory allocation used in C and C++. There is an “Automatic Garbage Collection” in Java that automatically reclaims the objects and arrays i.e. no need to remove the unreferenced objects.
And obviously, its syntax is based on C and C++ because it was initiated after C and C++. So it’s easy to understand Java if one knows about either C or C++.
As Java is very popular language and widely used in networked or distributed systems because Java program can migrate to and execute on network’s various platforms, it’s very important to safeguard these platforms from various threats like malicious codes that might spread viruses, steal sensitive information, etc. So Java’s secure feature enables it to develop virus-free and tamper-free systems. Its authentication technique is based on public key encryption and Java sand box security model. It provides virtual firewall between application and the computer. So Java programs are confined within Java Runtime Environment (JRE) thus it does not grant unauthorised access on the system resources. This is the most amazing feature among all the features of Java.
Other reasons of secureness
- Java programs runs within Java Virtual Machine (JVM).
- Omission of explicit pointer makes it robust.
- The class-loader adds the security by separating the package for the classes of the local file system especially from those which are imported from the network sources.
- The code fragments are checked by byte-code verifier for illegal codes which can violate access right to objects.
- The security manager determines what resources a class can access such as reading and writing to the local disk.
Together these all features prevent viruses and other dangerous threats and make it secured.
Object-oriented programming is totally based on object. Thus in Java, object is everything and with rules or concepts of object-oriented programming, we can organise programs as a collection of different types of objects, each of which represents instance of a class and also incorporates both data and behaviour. Java can be easily extended as it is based on object model, which is the basic feature among all the features of Java.
There are few rules/concepts of object-oriented programming (oops) for development and maintenance of software.
- Object: Objects are a key to understand object-oriented programming. It is the physical (tangible) as well as logical (intangible) entity. An entity has state and behaviour is known as object. For example- bike, car, table, pen, etc.
- Class: A class is a group of objects that has common properties and considered as a logical (intangible) entity. It is a template or blueprint from which object are created. For example- banking system.
- Inheritance: It is a mechanism in which one object acquires all the properties such as fields, methods, and behaviours of its parent object and it is called as inheritance. In other words, classes can be derived from other classes and a class that is derived is known as sub-class or extended class or derived class or child class.
- Polymorphism: It is the ability of an object to take on many forms. For example- when a parent class reference is used to refer to a child class object, then it is called polymorphism. Any object having more than on IS-A relation is considered as polymorphic.
- Abstraction: It is the process of hiding the implementation details and showing only the functionality to the user. For example- when you send an SMS, you just type it and send it. You don’t know how it being sending, what procedure is applied to it. So, abstraction only lets you focus on what object does instead of how it does by hiding internal procedure.
- Encapsulation: It is the mechanism of wrapping the data and the code acting on the data together as a single unit. For example- capsule i.e. combination of various medicine wrapped in a single capsule.
Java is a platform independent language. This statement can be justified by explaining platform and its dependency. As we already discussed that a platform is a pre-existing hardware or software environment in which a program runs by using its facilities and obeying its constraints. Java is a software based platform that runs on hardware based platform.
Actually, unlike other programming languages including C and C++, when Java is compiled, it is not compiled into platform specific machine, rather into platform independent byte code. This byte code can run on any platform such as Windows, Linux, mac/OS, etc. which means a program that is compiled on windows platform can run on Linux platform and vice-versa. The byte code is distributed over network and interpreted by respective platform JVM on whichever it is being run. That is why it is called as platform independent.
Java language becomes robust (strong) by handling the following problems efficiently which are generally occurred during compile and runtime checking.
- Mistakes in memory management can cause failure of program. To handle this problem, there is a garbage collection in Java that automatically de-allocates the objects which are no longer needed.
- Mishandling of runtime errors can also cause failure of program. And this is handled by exception handling and type checking mechanism.
- Security problems can be avoided by lack of pointers.
These are all the points which let Java implement strong memory management by eliminating error prone situations and become a robust language.
Architecture – neutral
Java compiler has the ability to generate the architecture neutral object file format (known as byte code) that makes the compiled code able to execute on many processors within the presence of Java runtime environment. Architecture neutrality also contributes to portability.
As we know that, Java programs written on one platform can run on another platform. The Java program compiled into byte codes which are platform independent and can be carried to any platform for execution that makes Java a portable language.
Interpretation is the process of figuring out the appropriate meanings of instructions of byte codes and then choosing equivalent canned platform specific instructions to execute. The virtual machine translates the byte code (instructions and associated data) to platform specific instructions through interpretation and then executes those instructions. The development process is more rapid and analytical since the linking is an incremental and light weight process.
Java is basically designed for the distributed environment of the internet. We can access files by calling methods from any machine on the internet. Actually, Java programs can be distributed on more than one machine that is connected to each other through internet connection. Objects on one machine (JVM) can execute procedure of a remote machine (JVM). We can create distributed applications in Java by using Enterprise Java Beans (EJB) and Remote Method Invocation (RMI).
To achieve high performance, Java programs must accomplished with several tasks at once. That is why; Java supports the concept of threaded execution. A thread is like a separate program, executing concurrently. With this feature of Java, it is possible to write programs that can do many tasks simultaneously by defining multiple threads. The main advantage of multi-threading is that it shares the same memory. This design feature allows developers to construct smoothly running interactive applications such as multi-media, web apps, etc. Multi-threading also contributes to high-performance.
Good interpretation helps to achieve the level of performance that is usually more than adequate. Java is faster than traditional interpretation since it use the “Just in Time” (JIT) compiler to do the interpretation. Since, byte code is close to native code, it analyses the interpreted byte code instruction sequences and compiles frequently interpreted instruction sequence to platform specific instructions.
Since, Java is designed to adapt to an evolving environment, it is considered as more dynamic than C or C++. It can carry more extensive amount of run time information that can be used to verify and resolve access to objects on run time. Because interconnection between program code and libraries happen dynamically at run time, it is not necessary to link them explicitly. As a result, when a program or one of its libraries evolves (for instance, bug fix, security issues or performance improvement), a developer only needs to distribute the updated program or libraries. This feature is helpful when we want to add code in run time such as GUI (Graphic User Interface) builders and debuggers.
Java is a network savvy (oriented) programming language as its extensive network library present in Java makes it easy to face with TCP/IP (Transmission Control Protocol/Internet protocol) network protocol such as HTTP (Hypertext Transfer Protocol) and FTP (File Transfer Protocol) and simplifies the task of making network connections. By the help of Java’s network capabilities applications with the help of URL’s (Uniform Resource Locator) can access and open objects across networks. This feature is as simple as accessing a local file over the system. For example, opening and closing of a socket connection and remote method invocation for establishing communications between distributed objects.
It is way of object oriented programming (oops) in which inheritance is achieved by defining classes of objects, as opposed by objects themselves.
Java is also considered as a concurrent programming language. Here, we are talking about Java’s computing that is concurrent.
Concurrent computing is a type of computing in which several computations are executing during overlapping time periods concurrently instead of sequentially. A concurrent system is one where a computation can make progress without waiting for all other computations to complete or more than one computation can make progress at the same time. Actually, it is a property of system that may be an individual program, a computer, or a network which get a separate execution point i.e. “Thread of control” for each computation or “Process”. It can also be say that. It is a modular programming that factors an overall computation into sub-computations that may be executed concurrently.
These are the features which were aimed during the creation of Java language, and finally they achieved all these features amd made it one of the revolutionary language.
Thank you for your patience 🙂
History of Java
There are number of things in history of Java which will make it very interesting to know those facts about Java language. There was a small team named as “Green Team” whose members…more…