Features of Java

Features of a language are nothing but the set of services or facilities provided by the
language vendors to the industry programmers. Java language provides 13 features to the industry programmers to develop various application as follows :

1. Simple
2. Platform Independent
3. Architectural Neutral
4. Portable
5. Multithreaded
6. Networked
7. Distributed
8. High Performance
9. Robust
10. Dynamic
11. Interpreted
12. Secured
13. OOPL (Object Oriented Programming Language)

Simple

Java is one of the simple programming language because of the following:

  • Java Programming does not support a complex concept called pointer. In other words every java program is totally free from pointers so that we get application
    development time is very less & application execution time is also less because of the magic of bytecode.

Bytecode: Bytecode is the set of optimized instruction generated during compilation
phase & it is more powerful than ordinary code.

JVM: JVM is the set of programs developed by Sun Microsystem & supplied as a part of JDK fro reading line by line
of bytecode & it converts into the native understanding form of operating system.

Java language is one of the compiled & interpreted programming languages.

  • Memory Allocation

Java programming execution environment contains inbuilt garbage collection  program for automatic memory management for strengthening the performance of JAVA/J2EE
application.

Garbage Collector: Garbage Collector is one of the background system java program which is running internally along with our regular java program for collecting unused/unreferenced memory space for improving the performance of our application.

Note: Java programming does not support destructor concept. In place of the destructor, we have garbage collector program.

  • Java programming is containing a rich set of API(Application Programming interface).

API(Application Programming Interface): An API is a collection of packages. A package is a collection of classes, interfaces & sub-packages. A sub-packages is a collection of classes, interfaces & sub-packages etc.

  • Java Programming is containing user-friendly syntaxes so that we can develop an effective application.In other words, if any language is providing user-friendly syntaxes, we can develop error free application.

Platform Independent

A platform independent technology/language related applications run on every operating system without considering their vendors.

In order to say that a particular language is independent if & only if it has to satisfy the following property:
(a)The language must have some data types & they must take some amount of memory space.
(b)The language must contain some special internal programs which will convert from one format of one operating system to another format of another operating system.

The languages like C, C++ are treated as platform independent application because:
(a)The data type of C, C++ takes the different amount of memory space on different operating system.
(b)The C, C++ software does not contain any special programs for converting one format of one operating system to another format of operating system.

The language like java is treated as platform independent language because:
(a) All the datatypes of java language take the same amount of memory spaces in all operating system.
(b)The software like java(JDK) contains some internal programs which will convert from one format of one operating system to another format of another operating system.

Note: The operating system DOS understands every language program in its understanding format called MOZARTA, whereas UNIX operating system
understand everything in embedded linking format.

Architectural Neutral

An application is said to be architectural neutral if & only if the application runs
on every processor without considering their architecture & vendors(Providers)

A language is said to be architectural neutral, then it has to satisfy the following
property :
(a)The software must have a special internal program which will convert the factor of one processor to factor of another processor.

The language like C, C++ are considered to be architectural neutral language because the above property is not satisfied.
The basic aim of Sun Microsystem is that java application must run without considering about software benchmarks & hardware benchmarks.

Portable

A portable application is one which will run on every operating system & on every processor without considering their vendor & architecture. The application of C, C++, PASCAL is treated as a non-portable application. All the java application are treated as portable application

According to sun microsystem:
Portability = Platform Independent Architectural Neutral

Conclusion: It is highly recommended in the industry to distributed application
with portable software but not by using a non-portable software.

Multithreading

Multithreading in java is a process of executing multiple threads simultaneously.
Multithreading is one of the distinct facility of java programming. The basic aim of multithreading is that to achieve concurrent execution. A flow of control is known as a thread.

The basic use of thread is to execute user/programmer defined function. If any java program is containing multiple flows of control then that java program is known as multithreaded.

The languages like C, C++, Pascal, COBOL, etc are treated as single threaded modeling language because their programming runtime environment contain single flow of control. With a single threaded modeling language we can achieve only sequential execution but not concurrent execution but not concurrent execution & these languages does not contain any library for development of multithreading application.

The language like java & .net is treated as multithreaded modeling languages because their execution environment contains multiple flows of controls.Multithreaded modeling languages provide both sequential & concurrent execution.Multithreading programming languages provide a library for development of multithreading applications.

In Java programming multithreaded application are developed by following:
1.java.lang.thread(class)
2.java.lang.runnable(interface)

The runtime implementation of multithreading concept is that to develop real-time or real-world servers such as tomcat, WebLogic, WebSphere etc.
Whenever we write any java program there exist two types of threads, they are
1.Foreground/Child
2.Background/Parent

A Foreground thread is one which always executes the logic of the java program or user program defined methods of java.
A Background thread is one which always monitors execution status of foreground threads.
By default there exist single foreground thread & single background thread in every java program. Programmatically there is a possibility of creating multiple foreground threads & recommended to have single background thread.
Multithreading is one of the specialized form multitasking concepts of the operating system.
How to justify “Every java program is multithreaded“?

Sol: A centralized application is one which runs in the context of a single server, it can be accessible across the globe.
e.g All banking software comes under centralized application. The diagrammatic representation of the centralized application is shown below.

The basic limitation of centralized application is that once the server is down, clients are unable to communicate unless & until it is uploaded again.
This makes us understand, the centralized application makes to understand less availability of data. All the centralized application to the industry are not containing public URL.
Distributed application are those which runs in the context of multiple servers & they can be accessible across internet & intranet application & they are running untrusted networks & trusted network so that industry is treating java as one of the networked programming languages.

Note: If any machine do not have storing & processing capability then that machine is known as non-autonomous otherwise it is known as autonomous.

Distributed

According to the industry standards, In java real-time application, applicants are classified into two types they are
1. Centralised Application
2. Distributed Application

When we run the java program, for executing the logic of our java program there exist one thread known as foreground thread. To monitor the status of foreground thread, there exist one more background java program known as garbage collector. For executing garbage collector there exist one thread known as background thread. Hence in java programming execution environment there exist above two threads. Therefore every java program is containing multiple threads.

Networked

The basic aim of networking is to share the data between multiple machines which are located either on the same network (local sharing) or in different network (global sharing).

A collection of interconnected autonomous & non-autonomous computers with the server is known as networking.

According to industry standard, we have two types of networks:
1. Untrusted Network
2. Trusted Network

An Untrusted Network is one in which there exist “Collection of interconnected non autonomous computer with the server”.This network architecture preferred by those organization
where business operation are restricted to a specific place known as small scale organization.These organizations prefer to have intranet application to
run on untrusted networks.To develop the intranet application we use J2SE(network programming language).

An Trusted network is one in which there exist “collection of interconnected autonomous computer with the server”. This network architecture is preferred by those organization whose business operation are spread over the globe(Large Scale Organization).
These organizations prefer to have internet application by making use of J2EE technologies. Finally using java one can develop the globe.
All the real-time websites are coming under distributed application.The basic advantages of distributed application is that even though one server is down, Client are able to communicate with other servers.This makes us to understand distributed application provide more availability of data. The negligible limitation of distributed application is that more investment is required for designing of high-end server.
Each & every distributed application have public URL’s.

High Performance

java is one of the high performance language because of following:

  • Because of the magic of the bytecode.[we know that ‘bytecode’ is the set of optimized instruction generated by the java compiler during the compilation phase & it is more faster than ordinary pointer code.
  • Because of the magic of the Garbage Collector[automatic memory management is taken care]
  • Java programming is free from pointer so that a java programmer can develop an application as early.
    whenever we store any real constant value in a float datatype variable then float datatype organizes the real constant value in such a way that after the (.) it takes 8 decimal point.
    In order to treat any real constant value as a float data type value tehn real constant value must be followed by a letter F in java otherwise it is a compile time error.

Interpreted

In the older version of java, compilation phase is faster than interpretation phase. Industry has complained to the Sun Microsystem saying that compilation phase is very fast & Interpretation phase is very slow.

So to solve this issue, Sun Microsystem has developed a program called JIT(Just In time Compiler) & added as a part of JVM to speed up the interpretation phase.

In the current version of Java, Interpretation phase is so faster than compilation phase.

Here java is one of the highly interpreted programming languages.

JIT: JIT is the set of programs developed by Sun Microsystem & added as part of JVM to speed up the interpretation phase, by reading the entire section of the bytecode & converting the native understanding form of operating system.

Robust(strong)

When we write any program in any programming languages, we come across various type of errors as follows:
1.Compile Time Error
2.Runtime Error

Compile time error are those which are resulted during the program compilation when the programmer is not following the syntaxes of the language.
Runtime error are those which are resulted during the program execution when the normal user
enters invalid input at runtime.
The language like C, C++, PASCAL, COBOL are not able to address runtime errors effectively hence these languages related application are not robust.
The Language like java is able to address the runtime error effectively by using a concept of exception handling.
Hence the java related application are robust.

Exception: Runtime error of java program is known as Exception.

Therefore Java is one of the robust language because of the inbuilt facility called exception handling.

Dynamic

In most of the programming language, memory allocation technique is divided into two types they are:
1.Static memory allocation
2. Dynamic memory allocation

A static memory allocation is one in which the memory will be allocated at compile time.
The limitation of static memory allocation are:
1.Waste of memory space
(The number of values we enter at runtime are less than the size of the array)
2.Loss of data
(The number of values we enter at runtime are more than the size of the array)
3.Overlapping of existing data
If an array contains overlapped values and if we try to insert a new value within the existing memory location of the array then we need to move the elements of an array either to downwards or upwards which is quite impossible in arrays.So that new value will be replaced by the existing value
because of the above limitation, java programming does not follow static memory allocation, but it always follows dynamic memory allocation.
The process of allocating the memory space to the input of the program at a runtime si known as dynamic memory allocation.
Dynamic memory allocation eliminates all the drawbacks of static memory allocation.
In java programming to allocate memory space dynamically, we use an operator called ‘new’.
“New” operator is known as dynamic memory allocation operator.

Secured

Security is one of the principles in information technology to validate whether is the user is authorized or unauthorized.
If we develop any project other than java language then as a programmer, we need to write our own special programs for dealing with security
which indicates other than java programming language by default unsecured.

In the case of java projects as a programmer, we need not to write any special programs on our own to deal with the security
which indicates the API of java is containing readily available security programs(which are implemented from network security subject)

Because of the readily available security program, experts felt that java is one of the high secured language.

Object Oriented Programming Language(OOPL)

In IT we have two models of languages as follows:

1. Procedure oriented programming language
2. Object Oriented programming language

When we store the data by using procedure oriented programming language that data can be manipulated by any unauthorized user.
According to industry expert, procedure oriented programming language provides 0% security so that it is not recommended for developing organization level application like banking, supermarket, transportation, etc.
Ex: C, Pascal, Cobol, ADA, etc

To eliminate the limitation of procedure oriented programming languages we have another model of language called object-oriented programming language.
In order to say any programming language, is object oriented, i has to satisfy all the complete principles/concepts of object oriented system/structure by object management group.
If we develop any application with object oriented programming languages then the data of that application cannot be manipulated by any authorized users, So the basic aim of object-oriented programming is that to provide effective security to the data
but all the programming language which are coming under object oriented may not be providing 100% security.
Ex: smalltalk, Lisp,Object pascal, object cobol, C++, java, .net etc.

Even though C++ listed under partial object oriented programming language because of the following reason:
(a) Every C++ program can be exactly written like a C program.
(b) A C++ program may or may not satisfy the complete principles of OOPS.
(c) C++ is having a concept called Friend Function which is trying to access private data which is not recommended.

The language/technology like java or .net are treated as object oriented because they satisfies completely all the OOPS principle
& no friend function concept is allowed. Object oriented programming contains 8 principles they are:

1. Classes
2. Objects
3. Data Abstraction
4. Data Encapsulation
5. Inheritance
6. Polymorphism
7. Dynamic Binding
8. Message Passing

Note: OOPL will be explained in upcoming blogs.

Blog at WordPress.com.

Up ↑

%d bloggers like this: