A First Simple Program
Now that the basic object-oriented underpinning of Java has been discussed, let’s look at some actual Java programs. Let’s start by compiling and running the short sample program shown here. As you will see, this involves a little more work than you might imagine.
NOTE : The descriptions that follow use the standard Java SE 6 Development Kit (JDK), which is available from Sun Microsystems. If you are using a different Java development environment, then you may need to follow a different procedure for compiling and executing Java programs. In this case, consult your compiler’s documentation for details.
How To Compile And Run Java Program
The javac compiler creates a file called Example.class that contains the bytecode version of the program. As discussed earlier, the Java bytecode is the intermediate representation of your program that contains instructions the Java Virtual Machine will execute. Thus, the output of javac is not code that can be directly executed.
When Java source code is compiled, each individual class is put into its own output file named after the class and using the '.class' extension. This is why it is a good idea to give your Java source files the same name as the class they contain—the name of the source file will match the name of the '.class' file. When you execute java as just shown, you are actually specifying the name of the class that you want to execute. It will automatically search for a file by that name that has the '.class' extension. If it finds the file, it will execute the code contained in the specified class.
Comments In A Java Languange Programming :
What is comments in java language:
1. In java The perticular line which you want to write in program this line can't executes the java compiler it also known as Comments.
1.Single Line Comments :
So Editing Friends Wait For Complete Our Timer Then You Can Download Our Materials For Free !!!


