Features of Java
Features of Java
1. Features of Java
1. Simple
2. Object-Oriented
3. Platform Independent
4. secured
5. Robust
6. Architecture Neutral
7. Portable
8. High Performance
9. Distributed
10. Multi-threaded
There is given many features of java. They are also known as java buzzwords. The Java Features given below are simple and easy to understand.
1. Simple
2. Object-Oriented
3. Platform independent
4. Secured
5. Robust
6. Architecture neutral
7. Portable
8. Dynamic
9. Interpreted
10. High Performance
11. Multithreaded
12. Distributed
Simple
According to Sun, Java language is simple because:
syntax is based on C++ (so easier for programmers to learn it after C++).
removed many confusing and/or rarely-used features e.g., explicit pointers, operator overloading etc.
No need to remove unreferenced objects because there is Automatic Garbage Collection in java
Java has a concise, cohesive set of features that makes it easy to learn and use.
Most of the concepts are drew from C++ thus making Java learning simpler.
Object-oriented
Object-oriented means we organize our software as a combination of different types of objects that incorporates both data and behaviour.
Object-oriented programming(OOPs) is a methodology that simplify software development and maintenance by providing some rules.
Basic concepts of OOPs are:
1. Object
2. Class
3. Inheritance
4. Polymorphism
5. Abstraction
6. Encapsulation
Platform Independent
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's a software-based platform that runs on top of other hardware-based
platforms. It has two components:
1. Runtime Environment
2. API(Application Programming Interface)
Java code can be run on multiple platforms e.g.Windows,Linux,Sun Solaris,Mac/OS etc. Java code is compiled by the compiler and converted into bytecode.This
bytecode is a platform independent code because it can be run on multiple platforms i.e. Write Once and Run Anywhere(WORA).
Secured
Java is secured because:
No explicit pointer
Programs run inside virtual machine sandbox.
Classloader- adds security by separating the package for the classes of the local file system from those that are imported from network sources.
Bytecode Verifier- checks the code fragments for illegal code that can violate access right to objects.
Security Manager- determines what resources a class can access such as reading and writing to the local disk.
These security are provided by java language. Some security can also be provided by application developer through SSL,JAAS,cryptography etc.
Robust
Robust simply means strong. Java uses strong memory management. There are lack of pointers that avoids security problem. There is automatic garbage collection in
java. There is exception handling and type checking mechanism in java. All these points makes java robust.
Architecture-neutral
There is no implementation dependent features e.g. size of primitive types is set.
Portable
We may carry the java bytecode to any platform.
High-performance
Java is faster than traditional interpretation since byte code is "close" to native code still somewhat slower than a compiled language (e.g., C++)
Distributed
We can create distributed applications in java. RMI and EJB are used for creating distributed applications. We may access files by calling the methods from any
machine on the internet.
Multi-threaded
A thread is like a separate program, executing concurrently. We can write Java programs that deal with many tasks at once by defining multiple threads. The main
advantage of multi-threading is that it shares the same memory. Threads are important for multi-media, Web applications etc.
1) Simple
Java is a simple language because of its various features, Java Doesn?t Support Pointers , Operator Overloading etc. It doesn?t require unreferenced object
because java support automatic garbage collection.
Java provides bug free system due to the strong memory management.
2) Object-Oriented
Object-Oriented Programming Language (OOPs) is the methodology which provide software development and maintenance by using object state, behavior ,
and properties.
Object Oriented Programming Language must have the following characteristics.
As the languages like Objective C, C++ fulfills the above four characteristics yet they are not fully object oriented languages because they are structured as
well as object oriented languages.
In java everything is an Object. Java can be easily extended since it is based on the Object model
3) Secure
Java is Secure Language because of its many features it enables to develop virus-free, tamper-free systems. Authentication techniques are based on public-
key encryption. Java does not support pointer explicitly for the memory.
All Program Run under the sandbox.
4) Robust
Java was created as a strongly typed language. Data type issues and problems are resolved at compile-time, and implicit casts of a variable from one type to
another are not allowed.
Memory management has been simplified java in two ways. First Java does not support direct pointer manipulation or arithmetic. This make it possible for a
java program to overwrite memory or corrupt data.
Second , Java uses runtime garbage collection instead of instead of freeing of memory. In languages like c++, it Is necessary to delete or free memory once
the program has finished with it.
5) Platform-independent.
Java Language is platform-independent due to its hardware and software environment. Java code can be run on multiple platforms e.g. windows, Linux, sun
Solaris, Mac/Os etc. Java code is compiled by the compiler and converted into byte code. This byte code is a platform independent code because it can be
run on multiple platforms i.e. Write Once and Run Anywhere(WORA).
6) Architecture neutral
It is not easy to write an application that can be used on Windows , UNIX and a Macintosh. And its getting more complicated with the move of windows to
non Intel CPU architectures.
Java takes a different approach. Because the Java compiler creates byte code instructions that are subsequently interpreted by the java interpreter,
architecture neutrality is achieved in the implementation of the java interpreter for each new architecture.
7) Portable
Java code is portable. It was an important design goal of Java that it be portable so that as new architectures(due to hardware, operating system, or both) are
developed, the java environment could be ported to them.
In java, all primitive types(integers, longs, floats, doubles, and so on) are of defined sizes, regardless of the machine or operating system on which the
program is run. This is in direct contrast to languages like C and C++ that leave the sized of primitive types up to the compiler and developer.
Additionally, Java is portable because the compiler itself is written in Java.
8) Dynamic
Because it is interpreted , Java is an extremely dynamic language, At runtime, the java environment can extends itself by linking in classes that may be
located on remote servers on a network(for example, the internet)
At runtime, the java interpreter performs name resolution while linking in the necessary classes. The Java interpreter is also responsible for determining the
placement of object in memory. These two features of the Java interpreter solve the problem of changing the definition of a class used by other classes.
9) Interpreted
We all know that Java is an interpreted language as well. With an interpreted language such as Java, programs run directly from the source code.
The interpreter program reads the source code and translates it on the fly into computations. Thus, Java as an interpreted language depends on an interpreter
program.
The versatility of being platform independent makes Java to outshine from other languages. The source code to be written and distributed is platform
independent.
Another advantage of Java as an interpreted language is its error debugging quality. Due to this any error occurring in the program gets traced. This is how it
is different to work with Java.
11) Multithreaded
Writing a computer program that only does a single thing at a time is an artificial constraint that we’ve lived with in most programming languages. With
java, we no longer have to live with this limitation. Support for multiple, synchronized threads is built directly into the Java language and runtime
environment.
Synchronized threads are extremely useful in creating distributed, network-aware applications. Such as application may be communicating with a remote
server in one thread while interacting with a user in a different thread.
12) Distributed.
Java facilitates the building of distributed application by a collection of classes for use in networked applications. By using java?s URL (Uniform Resource
Locator) class, an application can easily access a remote server. Classes also are provided for establishing socket-level connections.
1) Compiled and Interpreter:- has both Compiled and Interpreter Feature Program of java is First Compiled and Then it is must to Interpret it .First of all The
Program of java is Compiled then after Compilation it creates Bytes Codes rather than Machine Language.
Then After Bytes Codes are Converted into the Machine Language is Converted into the Machine Language with the help of the Interpreter So For Executing the java
Program First of all it is necessary to Compile it then it must be Interpreter
2) Platform Independent:- Java Language is Platform Independent means program of java is Easily transferable because after Compilation of java program bytes code
will be created then we have to just transfer the Code of Byte Code to anotherComputer.
This is not necessary for computers having same Operating System in which the code of the java is Created and Executed After Compilation of the Java Program We
easily Convert the Program of the java top the another Computer for Execution.
3) Object-Oriented:- We Know that is purely OOP Language that is all the Code of the java Language is Written into the classes and Objects So For This feature java
is Most Popular Language because it also Supports Code Reusability, Maintainability etc.
4) Robust and Secure:- The Code of java is Robust andMeans ot first checks the reliability of the code before Execution When We trying to Convert the Higher data
type into the Lower Then it Checks the Demotion of the Code the It Will Warns a User to Not to do this So it is called as Robust
Secure : When We convert the Code from One Machine to Another the First Check the Code either it is Effected by the Virus or not or it Checks the Safety of the Code
if code contains the Virus then it will never Executed that code on to the Machine.
5) Distributed:- Java is Distributed Language Means because the program of java is compiled onto one machine can be easily transferred to machine and Executes
them on another machine because facility of Bytes Codes So java is Specially designed For Internet Users which uses the Remote Computers For Executing their
Programs on local machine after transferring the Programs from Remote Computers or either from the internet.
6) Simple Small and Familiar:- is a simple Language Because it contains many features of other Languages like c and C++ and Java Removes Complexity because it
doesn’t use pointers, Storage Classes and Go to Statements and java Doesn’t support Multiple Inheritance
7) Multithreaded and Interactive:- Java uses Multithreaded Techniques For Execution Means Like in other in Structure Languages Code is Divided into the Small
Parts Like These Code of java is divided into the Smaller parts those are Executed by java in Sequence and Timing Manner this is Called as Multithreaded In this
Program of java is divided into the Small parts those are Executed by Compiler of java itself Java is Called as Interactive because Code of java Supports Also CUI and
Also GUI Programs
8) Dynamic and Extensible Code:- Java has Dynamic and Extensible Code Means With the Help of OOPS java Provides Inheritance and With the Help of Inheritance
we Reuse the Code that is Pre-defined and Also uses all the built in Functions of java and Classes
9) Distributed:- Java is a distributed language which means that the program can be design to run on computernetworks. Java provides an extensive library of classes
for communicating ,using TCP/IP protocols such as HTTP and FTP. This makes creating network connections much easier than in C/C++. You can read and write
objects on the remote sites via URL with the same ease that programmers are used to when read and write data from and to a file. This helps the programmers at remote
locations to work together on the same project.
10) Secure: Java was designed with security in mind. As Java is intended to be used in networked/distributor environments so it implements several security
mechanisms to protect you against malicious code that might try to invade your file system.
For example: The absence of pointers in Java makes it impossible for applications to gain access to memory locations without proper authorization as memory
allocation and referencing model is completely opaque to the programmer and controlled entirely by the underlying run-time platform .
11) Architectural Neutral: One of the key feature of Java that makes it different from other programming languages is architectural neutral (or platform independent).
This means that the programs written on one platform can run on any other platform without having to rewrite or recompile them. In other words, it follows 'Write-
once-run-anywhere' approach.
Java programs are compiled into byte-code format which does not depend on any machine architecture but can be easily translated into a specific machine by a Java
Virtual Machine (JVM) for that machine. This is a significant advantage when developing applets or applications that are downloaded from the Internet and are needed
to run on different systems.
12) Portable : The portability actually comes from architecture-neutrality. In C/C++, source code may run slightly differently on different hardware platforms because
of how these platforms implement arithmetic operations. In Java, it has been simplified.
Unlike C/C++, in Java the size of the primitive data types are machine independent. For example, an int in Java is always a 32-bit integer, and float is always a 32-bit
IEEE 754 floating point number. These consistencies make Java programs portable among different platforms such as Windows, Unix and Mac .
13) Interpreted : Unlike most of the programming languages which are either complied or interpreted, Java is both complied and interpreted The Java compiler
translates a java source file to bytecodes and the Java interpreter executes the translated byte codes directly on the system that implements the Java Virtual Machine.
These two steps of compilation and interpretation allow extensive code checking and improved security .
14) High performance: Java programs are complied to portable intermediate form know as bytecodes, rather than to native machine level instructions and JVM
executes Java bytecode on. Any machine on which it is installed. This architecture means that Java programs are faster than program or scripts written in purely
interpreted languages but slower than C and C++ programs that compiled to native machine languages.
Although in the early releases of Java, the interpretation of by bytecode resulted in slow performance but the advance version of JVM uses the adaptive and Just in time
(JIT) compilation technique that improves performance by converting Java bytecodes to native machine instructions on the fly.