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.)