Sunteți pe pagina 1din 2

Features of Java

Simple
Java omits rarely used, poorly understood features those are available in C++.
These features include operator overloading, multiple inheritance, destructors, allocation and freeing of
memory.
Inheritance is simplified by supporting only inheritance, as there is ambiguity in multiple and hybrid
inheritance.
Garbage collection is the feature which reclaims the memory space by removing orphan objects
automatically.
Java is much easier to write bug free code. Java language is easy to read and write. Java provides bug free
code to allocate and deallocate memory automatically.
Object-Oriented
Object oriented programming is promoted as a productive and more natural way for viewing solutions to
problems.
The classes that are created in one project can be reusable on another project.
Object oriented programming is a natural implementation of software development.
As most of the problems are stated as objects, the way of implementing OOP is simple.
Robust
More emphasis on early checking of the possible problems, later dynamic checking are put by Java.
This eliminates the error prone solutions.
The biggest difference between Java and C++ is that Java has a built in pointer model which eliminates the
overwriting memory and data corruption.
Java has true arrays which allow the checking of subscript. Java applications can not gain unauthorized
access to memory.
Java supports exception handling. Certain abnormal situations can be resolved by using this feature.
Flexibility is gained by separating the regular program logic from exception program logic.
Distributed
Java has extensive library routines to deal with protocols like TCP/IP,HTTP, FTP
Creation of network connections is much easier than C or C++.
The objects can be accessed across the internet via URLs with ease
Portable
Java compiles source code to bytecode.
The intension of bytecode is to execute by Virtual Machine which need to be in native machine code.
For each processor type and operating system, JVM need to be compiled for that specific type of machine.
Any java bytecode can execute on other machines with JVM.
Interpreted:
Bytecode s translated to native machine instructions interpreted- on the fly and are not stored anywhere.
As linking is lightweight and more incremental process, the process of development could be exploratory.
Compile time information is carried over and available at runtime which is the base for the linkers type
checks
Multithreaded:
Multithreading is one of the multitasking paradigms. Two parts of the same application can be run
concurrently.
For example, in a word processing application, writing the document and checking the spellings can be done
at a time. This is known as thread based multi tasking.
The central idea of multithreading is to minimize the CPU idle time. For example, a car engine keeps running
regardless of whether car is moving. The objective is to keep the car moving as much as possible, so as to
gain maximum mileage.
One benefit of multithreading is better interactive responsiveness and real time behavior.
Platform Independent:
Java byte code is generated after compiling Java code.
Byte code is independent of the computer systems.
The byte code is submitted to the JVM of the system, in which it need to be executed. Every system has its
own JVM.
The byte code is interpreted by JVM. JVM invokes Just In-Time compiler to convert native byte code into the
byte code of the running system. Hence, Java is platform independent.
Secure:
Java enables tamper-free, virus-free systems.
The public-key encryption techniques are authenticated in network and distributed environments
Using private access specifier, data / operations on data can not be shared by another class, except the
class in which they were declared.

What is JVM? Explain its roles and functions.
Java Virtual Machine executes the byte code of another platform with simple platform specific instructions
JVM implements non-Java programming languages like Ada.
Roles and functions of JVM:
JVM loads class files
Class files are verified to determine whether the .class file contain valid byte code
Interpretation of byte code and running the application
Garbage Collection the process of reclaiming memory space by removing orphan objects.
Explain why Java is called as Platform independent language. Explain how Java executable executes on any
platform where JVM is available.
Java byte code can run on any OS with java installed.
JVM takes care of executing of native byte code.
Java executable executes the byte code after converting the native byte code into system specific byte
code.

S-ar putea să vă placă și