Recent Posts

Responsive Ads Here

Saturday, 2 April 2016

Features of java

top 10 features in java
                  

Features of a language are nothing but the services or facilities or functionalities provided by language to the industry programmers .

1.Simple
2.Platform Independent
3.Architecture Neutral
4.Portable
5.Multi threaded
6.Distributed
7.High performance
8.Robust
9.Secured
10.Dynamic
11.Object-oriented
12.Highly Interpreted


1.Simple :- After you know the key factors of java ,then you can say java is a simple programming language.So as of now we can see what is simple in java, and how can we say java is a simple.
“ Java is one of the simple programming language ,because of following factors.
    1. Java seems to be familiar to the existing programmers who are related to C & C++.
    2. Java omits many rarely used ,poorly understood, confusing features of C++,like operator  overloading ,multiple inheritance ,automatic coercions           etc.
    3. Java has no go to statement.
    4. Java eliminates much redundancy example No Structures, Union functions.
    5. Java has a Garbage Collector, so the programmer will have not to worry about storage management.
 6.Java has a rich predefined class library which means Application Programming Interface (API).”               
 7. Java Programming eliminates complex concept called pointers, so that application development time is less and application execution time is less, because of magic of byte code.

What is Byte code ?
byte code wiki
Internal Flow
                      
Byte code is set of optimized instructions generated by Java compiler during compilation phase and native of byte code is much powerful than ordinary pointer code of C,C++ languages.Do not think much about byte code now ,I covered full details about Byte code in JVM architecture.
Note:Java Programming is one of the compiler and interpreted based programming language .

What is an API ?
API stands for Application Programming Interface.An API is a collection of packages, a packages is a collection of predefined classes, interfaces and sub packages.A sub packages in turns contains classes, interfaces and sub packages etc.

Packages
Classes
Interfaces

2.Platform Independent :- 

what is platform independent ?
Platform view 

                Java code can be run on Multiple platforms like WINDOWS,LINUX,SUN SOLARIS ,MAC XOS etc.we developed and compile our program in WINDOWS.Then we can run our program in MAC.Because of java is a platform independent.which means WINDOWS is one kind of platform and LINUX is a one kind of platform and MAC XOS is one kind of platform.
                               So we can say write once and run anywhere.In order to say a language is platform independent it has to satisfy following properties.

1.the language related data types must take same amount of memory space on each and Every O.S
Example : In java int is one of the data type,in there we can store integer type of values and length of it is 4Bytes.
The point is, In WINDOWS or MAC XOS or any other platform must take 4 bytes for int data types.
2.The language must contains some special internal program & whose role is converting native understating form of one OS into native understanding form of another OS.
3. So finally by this factors we can say ,java is a platform independent.
Moto of Java is “WRITE ONCE RUN ANYWHERE”

3.Architectural Neutral :-A language /technology and whose related applications are said to be architectural neutral ,if they runs on every processor without considering their architectures and vendors.To say a language or technology is an architectural neutral ,it has to satisfy the following property.

1.The language /technology must contain some special programs and whose role is converting the factor /key of one processor to factor /key of another processor .

2.Easy to interpret on any machine .
  
4. Portable :-
An application runs on every OS and on every processor without considering their architectures and vendors.

1. Portability =Platform Independent + Architectural Neutral

2.Where as java language and whose applications are said to be portable
format of exe file in java
Format of exe file
                         
5.Multi threading :- Java allows multiple concurrent threads of execution to be active at once.This means that you could be listening to an audio while scrolling the page and in the background downloading an image.Java contains sophisticated synchronization primitives,that are integrated into the language to make them easy to use and robust.

The main advantage of multi threading is that .it shares the same memory.Threads are important for multimedia ,web application etc.when we write a java program there exists a two  types of threads.

1.Foreground Thread/Child Thread
2.Background Thread/Parent Thread
1.Foreground thread/Child thread: Foreground thread is one which always executing logic of a java program,which is written in the form of user defined methods.
2.Background Thread /Parent Thread : A background thread is one which monitor execution status of foreground thread.
3.The real time implementation of multi threading concept is that to develop real world server softwares such as Tomcat ,web logic etc.Most of the real world server softwares developed by third party server vendors in java language by using Multi Threading concepts. Multi Threading of java is one f the specialized form of multi tasking of operating systems.


6. Distributed :-
It has a spring like transparent RPC system
1.Now days use mostly TCP-IP based protocols like FTP&Http
2.ava supports various levels of network connectivity through classes in java.net package
Example The URL classes allows a java application to open and remote objects on the internet .

7. High Performace :- Java is an interpreted language ,so it will never be as fast as compiled languages like C,C++.In fact ,it is about 20 times slow as “C”.However this speed is more than enough to run interactive ,GUI and network based applications,where the application is often idle ,waiting for the user to do something or waiting for data from network.
However we can say java is one of the high performance programming language.
1.Byte code (It reduce useless execution time)
2.Memory Management (Garbage Collector Collects unused memory space for improving performance of java application)

8.Robust :- Java is one of the strong programming language ,because it contains following facilities .

1.Java has been designed for writing highly reliable and robust software .
2.Java does automatic garbage collection ,which means prevent memory wastage
3.Extensive compile time checking ,so bugs can be found early ,this is repeated at run time for flexibility and to check consistency .
4.Java has Exception Handling .The languages like C,C++,PASCAL,COBOL  etc  &  whose applications are treated as weak ,because these languages does not contain a facility called Exception Handling .

9.Secured :-
Security is an important concern,since java is mean to be used in networked environments.Java memory allocation model is one of its main defences against malicious code ,example cannot cast integers to pointers ,so can not forge access.

1.Access restrictions are enforced (Public ,Private)
2.Byte codes are verified ,which copes with the threat of a hostile compiler
3.Program run inside virtual Machine Sand Box
4.In Java we have a dedicated API (Library ) for dealing with security .i.e in java projects ,a java programmer need not write any security program on their own and they can use readily available security program present in the exisiting API
Javax.security.*

10. Dynamic :-

In any Programming language ,we have two types of memory allocation techniques,they are
1.Static Memory Allocation
2.Dynamic Memory Allocation

1.Static Memory Allocation:- In static memory allocation memory space is created /allocated for input of the program at compile time.
*Due to static memory allocation we get the following limitations
     1.Waste of memory space
     2.Loss of data
     3.Overlapping of Existing Data
*To avoid these problems industry is highly recommended to follow dynamic memory allocation.
2.Dynamic Memory Allocation :- In Dynamic memory allocation ,the memory space is allocated for input of the program at run time.Java programming follows only Dynamic Memory Allocation ,but not static memory allocations.
*Java was designed to adapt to an evolving environment
* Java loads classes as they are need ,even from across the network.
*It defers many decisions (like object layout ) to runtime ,which solves many of the version problems that C++ has .


11. Object –oriented :-
Java is an object –oriented language, which means that you focus on the data in your application and methods that manipulate that data, rather than thinking strictly in terms of procedures. In an object oriented system, a class is a collection of data and methods that operate on that data. Taken together, the data and methods describe the state and behaviour of an object. Classes are arranged in a hierarchy ,so that a subclass can inherit behaviour from its superclass comes with an extensive set of classes ,arranged in packages ,that you can use in your programs.

12.Highly Interpreted :- The java compiler generates byte code,rather than primitive machine code to run a java program.we use the java interpreter to execute the complied byte codes.Java byte cides provide an architecture neutral object file format.The code is designed to transport programs efficiently to multiple platforms. 
                   In the initial versions of java compilation phase is very faster and interpretation phase is very slow.In the later versions of java SUN developers has developed a Program called JIT(Just In Time Compiler) added as part of JVM and whose role is to speed up interpretation phase by reading the entire section of the byte code and converting into native understanding form of OS.



No comments:

Post a Comment