XtGem Forum catalog

Before u start with ur For Loop ka Program u have to install JDK on ur PC for more installation Refrence

click here

Step 1:

Open notepad
(Click on "Start-button" then click on "Run"
in Run type "Notepad")

Step 2:

Now type the following codes in that notepad

class SayForLoop

{

public static void main(String[] args)

{

for(int i=1;i<=10;i++)

System.out.print("\n"+i);

}

}

Step 3:

save it in"C:/java/Jdk/bin"with the name same as that main class is having and with the extention of".java"
"SayForLoop.java"
also make the file type as "All Files"


step 4:

now the time of compiling
Open "CMD"(command promt) and write the following cammand.(after each command click Enter.)

cd\

cd java\jdk\bin

javac SayForLoop.java



java SayForLoop