Resources » Articles/Knowledge Sharing » Computer & Technology
General features and properties of java
This article gives a detailed description about various features and properties of Java. How simple and secure Java is and how it can be run in multiple platform and how distributed language Java is, all has been explained in this article.
Simplicity of Java
Java is a very simple language. It is a strongly typed language. It is case sensitive also. Java was developed by taking the best points from other programming languages, mainly C and C++. Java therefore utilizes algorithms and methodologies that are already proven. Error prone tasks such as pointers and memory management have either been eliminated or are handled by the Java environment automatically rather than by the programmer.
Java can be learnt very easily if the person has the basic knowledge of the concepts of a programming language. Because Java is primarily derived from C++ or C language which most programmers have learnt, it means that Java has a familiar feel and ease to use.
Object-orientation of Java
All the concepts of java are based on classes and its objects. Even though Java has the look and feel of C++, it is a wholly independent and dynamic language which has been designed to be object-oriented and follows the bottom-up approach. In object-oriented programming (OOP), data is treated as objects to which methods are applied. Java contains objects that have some attributes and behaviors. Advantages of OOP are: inheritance, code re-usability, portability, extensibility and dynamic applications.
Distributed nature of Java
Java is a distributed language that means it can be used for creating applications that can run on networks or access remote objects. Java can easily access the remote objects. Internet programmers can call on the functions through the supplied libraries and be able to access files on the Internet as easily as writing to a local file system. Java was designed with networking in mind and comes with many classes to develop advanced applications that can easily run over a network. It is portable also.
Interpreted behaviour of Java
When Java code is compiled, the compiler outputs the Java bytecode which is then executed and interpreted by the JVM (java virtual machine). The Java Virtual Machine does not exist physically but is a hypothetical machine that can run Java executable code. It converts the bytecode into a platform specific machine code that can be understood by the computer.
Platform independent feature of Java
Java is a language that is independent of the clutches of an operating system. The reason why java code can run on any kind of operating system is the JVM. JVM is responsible for converting the bytecode into machine specific or platform dependent machine code or native code. Nowadays all the web browsers support JVM. So one does not need to install it separately. It is a hypothetical machine that makes java platform independent.
Security in Java
Java is a secure language that does not violate the principles of security. The Java language has built-in capabilities to ensure that violations of security do not occur anywhere. Java works to minimize the errors as far as possible so that the program works in the correct manner for which it was designed for.
Applet is a small program that is built in an application. This ability of classes or applets to come from unknown locations and execute automatically on a local computer pose a great threat to the security of the terminal on which it is running. Internet is often a source of some viruses or worms which can invade the local computer system and create all sorts of problems for the computer system to run.
Robustness in Java
Java performs the checking at the compilation time and when the code is executed. It carries out checking at both compile and run-time making sure that every error is solved before the application is deployed. It ensures that no error should be left unchecked so that the program can execute efficiently. Exception handling is built in java so that unknown exceptions do not occur at run-time.Local variables must be initialized. The garbage collector is also one of the most important parts that provide the language robustness. It helps in saving and utilizing the memory space of the processor efficiently.
Memory management in Java
First and foremost, at compile time, pointers and memory allocation are removed. Memory allocation is deferred until run-time. All the unused objects that do not point to any physical location are automatically collected by the garbage collector. Even though the Java compiler produces only correct Java code, there is still the possibility of the code being tampered with between compilation and run-time. Java guards against this by using the bytecode verifier to check the bytecode for language compliance when the code first enters the interpreter, before it ever even gets the chance to run.
Dynamic Binding in Java
The linking of data and methods is done at run-time. New classes can be loaded while a program is running. Linking is done on the fly. Even if libraries are recompiled, there is no need to recompile code that uses classes in those libraries.
Architecture-neutrality in Java
The Java compiler compiles source code to a specific machine code. This intermediate stage is known as the bytecode. Java is platform-independent. Thus it can run on computer system that have different operating systems. The bytecode conforms to the specification of a hypothetical machine called the Java Virtual Machine and can be efficiently converted into native code for a particular processor.
Portability in Java
Java Virtual Machine is inbuilt in every internet browser. So it ensures that all code that is compiled will run on that system. This forms the basis for Java's portability. Portability ensures that the compiled code can be executed on any type of computer even if it has a different kind of architecture. The main benefit of portability is that the programmer of the code does not have to worry whether the code would run properly on a different computer system.
Multi-threading in Java
The Java language supports multi-threading, a feature that has increased the performance of the computer system.The smallest unit of a program is called a thread, can easily be spun off to perform multiprocessing. It can take advantage of multiprocessors where two processors work at the same time. It is also great for multimedia displays.
Java has made use of multi-threading to help overcome the performance. It helps in increasing the performance of the processor. The reason behind this is that in multi-threading the processor executes more than one thread simultaneously. So the performance is increased by many folds. Since the bytecode produced by the Java compiler from the corresponding source code is very close to machine code, it can be interpreted very efficiently on any platform.
Dynamic behaviour of Java
By connecting to the Internet, a user immediately has access to thousands of programs and other computers. During the execution of a program, Java can dynamically load classes that it requires either from the local hard drive, from another computer or over the network. Code is compiled to bytecode that is interpreted by the Java virtual machines (JVM). This provides portability to any machine for which a virtual machine has been written. The two steps of compilation and interpretation are performed for removing errors.
Read related articles: Features of Java
Did you like this resource? Share it with your friends and show your love!
No responses found. Be the first to respond...