Would you like to make this site your homepage? It's fast and easy...
Yes, Please make this my home page!
Java Tutorial
Steps to write a program in java
- Click on Start-->Programs-->accessories-->Notepad
- Write a program
- Click on SaveAs
- Select the Drive From down arrow
under the tilte Save in
- Double click on directory jdk1.3
(Or any other java directory you may have)
- Click on "Bin" Subdirectory
- Type the name of the program which should be same as the name of Class in spelling with extension 'java'(for Example 'SampleCode.java')
- Click on the Save
- The file will be saved in 'Bin' subdirectory
Steps to Compile a program in java
- Click on Start-->Programs-->MsDos Prompt
- Type "CD\Jdk1.3\bin" and press Enter
- Type "Javac SampleCode.java" to compile the file SampleCode.java
- A file with name "SampleCode.class" Gets Generated
Steps to get output of a Java Application
- Click on Start-->Programs-->MsDos Prompt
- Type "CD\Jdk1.3\bin" and press Enter
- Type 'Java SampleCode' to get the output of the program
Sample Application Program
Output of The Program
(In Red Rectangle)
Sample Applet Program
File name : SimpleApplet.java
import java.awt.*;
import java.applet.*;
public class SimpleApplet extends Applet
{
public void paint(Graphics g)
{
g.drawString("Welcome to the World of Applets",20,20);
g.drawString("First Java Applet",40,40);
}
}
Sample Applet HTML code
File name : App.html
<HTML>
<applet code = "SimpleApplet" Width = 190 height =50>
</applet>
</HTML>
Output of The Program
(In Rectangle)
Other Sample Programs
Other Attractions
Thanks for Visiting us

Home