30-03-2011, 11:35 AM
[attachment=11316]
JAVA Is an object oriented, multithreaded programming language developed by the SUN Microsystems in 1991.
The popularity of java is beacause of 3 key elements: -
1) Applets.
2) powerful programming construct.
3) Rich set of objects.
When a program is compiled, it is translated into machine code that specific to the processor.
In the java development environment there are 2 parts: -
1) Java Compiler
2) Java Interpreter
The java compiler generates Bytecode. Bytecode is a set of instruction that resemble machine code but are not specific to any processor instead of machine code.
The Interpreter executes the java program.
In order to write a java program, an Editor, a Java Compiler and a Java Runtime environment are needed
The Editor can be a Notepad, Wordpad, MS-DOS editor. The easiest way to get a Compiler & Runtime environment is to dowmload Sun's Java Development Kit.
This provides utitlity functions in addition to classes that support networking, common internet protocls & user interface toolkit functions.
Features of JAVA
1) Simple & Powerful: -
Java was designed to be easy for the professional programmers to learn & use effectively. Unlike other programming languages provides many complicated ways to perform a simple task. Java provides a small number of clear ways to achieve a given task.
Anyone can master java with a little bit of programming experience. If the user already knows Object oriented programming, then learning java will be much easier.
2) Secure: -
People feel that conducting commerce over the internet is not so safe because of viruses & system hackers. To overcome all this fears java provides safety & security.
Using java compatible browser, anyone can safely download java applets without the fear of viral infection.
3) Potable: -
Many types of computers & operating systems are in use throughout the world & are connected to the internet. Java is portable through different platforms connected to the internet.
4) Object Oriented: -
The object model in java is simple & easy to extend.
5) Robust: -
Java virtually rectifies the problem of memory management by managing memory allocation & automatic memory deallocation by providing garbage collection for unused objects. Java also handles exceptional conditions by providing exceptional handling.
6) Multithreaded: -
Java supports Multithreaded programming, which allows the user write programs that perform many functions simultaneously.
7) Architectural-neutral: -
The main goal of java is "Write once; run anywhere, anytime, forever" and as a result JVM was developed.
Since java is a architectural-neutral the JVM generates bytecode that resembles machine code, and are not specific to any processor.
8) Distributed: -
Java is designed as a distributed language for creating applications on networks. It has the ability to access both data & methods. Java applications can open & access remote objects on internet as easily as they do in a local system.
public static void main(String args[])
Public: - It is an access specifies that declares the main() as unprotected & therefore making it accessible to all other classes.
Static: - It declares this method as one that belongs to the entire class & not a part of any objects of the class. The main method must always be declared as static since the interpreter uses this method before any objects are created.
Void: - It states that main method does not return any value.