Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

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.

Java


Java Introduction

java-oracle-logo, java, java introduction
Java is an open-source API (application programming interface) provided by the Oracle Corporation(currently) and its free API, anyone can use for the development of the business application/software.

Java is an Object-Oriented programming language, which is executed by a machine to reduce the burden of a user or human being by performing the operations faster without any mistakes.
It is machine-independent programming, we can run java application on any machine with the help of java virtual machine(JVM).
Program: A program is a set of instructions.
Software:  It is a set of programs, which can perform multiple tasks.

Software classified into two types:

1. System software

The software is designed to interact or communicate with the hardware device and make them work is called system software. This software is generally developed in a language like c, c++, etc.
Example: Operation System, driver, compiler, etc.

2. Application software

The software which is designed to store data, provide entertainment, do business, generate reports, etc. are called as application software. This software generally developed in a language like java, .net, python, etc.
The Application software’s are further classified into two types.

I. Standalone software:  

The software which can execute in the context of a single machine(computer) is called as standalone software.
Example: MS-Word, media player, etc.

II. Web-based software: 

The software which can be executed on any a machine in the context of browser is called as a web-based software.
Example:  Gmail, Facebook, etc.

Java History

James Gosling, Mike Sheridan, and Patrick Naughton started the first java project in 1991 for the Digital Cable Television Industry. Java is an object-Oriented, multi-purpose, cross-platform programming language. Java versions are provided in the form of Java development tools (JDK) it's completely free(Open Source).
The java language is released by Sun Microsystem in the year 1995 in three editions.

  1. JSE(java standard edition): This edition can use for developing standalone software.
  2. JEE(java enterprise edition): This edition can use for web-based application/software.
  3. JME(java mobile edition): This edition used for developing an application for mobile devices, wireless devices, embedded controllers, etc. where memory is limited.

Java Coding Example

package in.blogspot.scholars.java;

public class JavaCodeExample
{
public static void main(String[] args)
{

System.out.println("hello java programming language”);
}
}