2014-12-18

Basics of Java

Java is an object oriented programming language. It is not a platform dependent. Java is a high level language and also it is a third generation language like C, FORTRAN. Java is a general purpose language. It is developed by James gosling and Patrick Naughton from sun Microsystems in June 1991. This programming language is not dependent on any hardware and operating System. This language was first named by Oak. Oak name was changed by Java in 1995. It is used for develop the web application.



Characteristics of java

Simple, small and familiar

Object oriented

Distributed

Robust

Secure

Architecture neutral or platform independent

Portable

Compiled and interpreted

High performance

Multithreaded and interactive

Dynamic and extensible

Simple, small and familiar

Java is a simple and small language. Syntax of java is like a c++ language. So it is easy to learn. But it is easy to develop the program than c++ language.

Reasons are….

No need to use header file

Pointers are not used in this language.

Operator overloading and virtual base class are not used.

It is a small and object oriented language. Using this language, we can develop the software, which is used by the small computer.

Object oriented

Java is object oriented programming language. Object can be used in this language. Object and class contains all program and information. And object of java is a simple and easy to extend. It is a simple methodology for develop the software.

Distributed

Java has strong networking technology. Using java language, we can develop the application of networking. And also develop the application used in the Internet. Using this feature, we can use same application from different places in the world.

Robust

Other languages did not give important to memory management and detect of the program in different situation. So most of the programs are failed. But in java, these problems are solved by the garbage collection and exception handling. There is lack of pointers that avoids security problem. In garbage collection, java program can be used to remove the unwanted object using the small program. So programmers are easy to manage the memory. There is exception handling and type checking mechanism in java.

Secure

Security is very important for the java program because, the java can be used for create a program, which can be used in the internet. Before the interpret process the Security process can performed. Interpret is a process of converting machine code from the byte code. This scheme can be used for check whether the program has virus or not. Secret signature is used in the java code. Using the signature, receiver can receive the java code from the internet. If the signature is incorrect, receiver cannot get the java code from the internet. This mechanism is called digitally signing.

Architecture neutral or platform independent

Java compiler is generating the byte code. This byte code is not depending on the platform. This byte code can be used in all system. Java code can run on multiple platforms. Platform is a combination of software and hard ware resources.



Portable

Java compiler is generating the byte code. So, we can use the java code in any system. Java code can easy to change from one system to another system. And perform the execution on the system.

Compiled and interpreted

Commonly, the computer languages can perform only the compilation or interpretation. But java programming language can perform the compilation and interpretation.  Java compiler is used to generate the byte code from the source code. This byte code is not a machine code. And the java interpreter is used to generate the machine code from the byte code (generate by the java compiler). This machine code can use in the machine directly.



High performance

Java interpreter is use the byte code for the high performance on the execution. When compare with other language like C, C++, the java code is highly perform the execution.

Multithreaded and interactive

In java, multiple action can perform in same time using the multithreading. And also java program is used to generate the interactive program. Multithreading is a process of share the same memory.

Dynamic and extensible

Java language is a dynamic language. During run time, the program can link the new class and method, if they need. These types of methods are known as native method. Java program can use the function. The native method is link to program on dynamically.

Example Java Program:-

import java.io.*;
class cls_name
{
public static void main(String ar[])
{
System.out.println("This is the sample Java Program");
}
}

Download Source Code

Output Screen:

Show more