Java Programming

Java is a programming technology developed by Sun Microsystems. Java is an object-oriented language. Java can be used for web development.

Java is platform independent. The java code is compiled into a bytecode that can be run on a Java Virtual Machine(JVM). So Java code will run on any system that has a JVM installed in it. Java is robust, flexible and scalable. It can also be used to communicate with legacy systems.

Java provides a lot of classes or objects. Java Swings is a tool-kit that has a wide range of objects from text-boxes to menu bars to make website design easy.

Java programs consist of classes. Classes consist of methods. Java language can be used to develop object oriented applications.

Visit

http://learnjavatoday.blogspot.com

for more details.

The simplest form of a java program is as follows:

// Java program 1

public class Welcome1{

public static void main (String args[])

{

System.out.println ( “Welcom”);

}

}

In the above example;

// denotes that the statement is a comment and it not considered for programming.

The statement public class welcome1 is used to define the class. Java programs consist of classes defined like this.

The statement public static void main is used to define program building block. Every java program consist of a main function.

The statement System,out.println is used to produce the output. It gives instructions to the computer to print the String as an output.

Save the above program as Welcome1.java in the java Bin Directory.

Example C:javabin

The next step is to create the .class file by compiling the .java file.

In the dos prompt,

Type javac Welcome1.java and press enter.

It will produce a .class filee.

The final step is to run the class file. Type java Welcome1 to execute the .class file.

You will receive the desired output.


TOP