Friday, August 16, 2019

Java Features

The various features of java language are:

1) Simple: 

The java language is called as a simple programming language because of the following reasons.
  1. The syntax of java programming language similar to another programming language like c, c++, etc and simple to migrate from other languages.
  2. Complex topics like pointers, templates, etc. are eliminated from java making it simple.
  3. In the Java language, the programmer is responsible for the only allocation of memory. The deallocation of the memory is done by the garbage collector

2) Object-Oriented: 

The java language is called an object-oriented language. Any language can be called object-oriented if the development of the application is based on objects and classes.
  1. Object: Any entity that exists physically in this real-world which requires some memory is called an object. Every object contains some properties and some actions. The properties are the data which describes the object and the actions are the tasks or the operations performed by the objects.
  2. Class: A class is a collection of common properties and common actions of a group of objects. A class can be considered as a plan or model or a blueprint for creating the objects. For every class, we can create any number of objects and without a class, the object can't be created. Example: class: Student  object: tonny, rajiv
    java-object-oriented

3) Secured: 

Security one of the most important principles of any programming language. The java language contains inbuilt security programs for projecting the data from unauthorized usage.

4) Distributed: 

Using the distributed features we can access the data available in multiple machines and it to the user. Using these features we can improve the performance of the application by making the data more available and more accessible.

5) Platform Independent or machine-independent or Architecture Neutral: 

Java program can be executed on any machine irrespective of their hardware, software, architecture, operating system, etc, therefore, it is called a platform-independent language.

C language: when we compile a C program, the compiler verifies whether the ‘C’ language instruction valid are not if valid the compiler generates .exe file  containing machine language instructions.

Demo.c ( c lang. inst.)      compiler       Demo.exe(machine lang. inst.)

The machine language instructions available in the .exe files generated by the compiler can be executed only in that machine, where it is compiled. If we want to execute the C language makes it machine dependent language.

Java language: When we compile java program, the compiler verifies whether the java language instructions are valid or not,  if valid the compiler will generate .class a file containing special java instructions(byte code instructions).

Demo.c ( c lang. inst.)    compiler      Demo.class(byte code inst.)

The special java instructions available in the .class file generated by the compiler can be executed on any machine with the help of JVM, without recompile it. This nature of java language makes it platform-independent.

6) Interpreted: 

The java language said to interpreted language as the execution of the program is done by the interpreter available inside the JVM.

7) High performance: 

The execution of the program is done by the interpreter along with the special compiler and JIT(Just-in-Time) compiler, thereby reducing the execution time and improving the performance of the application.

8) Portable: 

We can develop an application which is a collection of components which can be replaced and reused.

9) Multithreaded: 

Every thread in java program is a control. if the program contains multiple controls then we can reduce the waiting time, and provide response faster and thereby improving the performance.

10) Dynamic: 

The java program is said to be dynamic because the allocation of memory is done at execution time according to the requirement.

11) Robust: 

The java language said to be a strong programming language. Because of the following reasons: 
  1. Memory Management: In java language allocation of memory and deallocation of memory, both are efficient. During the memory allocation time, there will be no wastage of memory and deallocation done by garbage collector which also efficient as the unused memory will be removed.
  2. Exception handling: the errors the occurs at runtime because of logical failure, invalid input is called as the exception. When an exception occurs, the application will be terminated abnormally and execution incompletely. In order to code execute completely and terminate normally. We can take the help pf exception handling. The process of execution handling in java is simple and efficient.

0 comments:

Post a Comment