According to me (Lucky), in any of the programming language we must know about following three things
1. How to print info on Screen?
2. How to take input?
3. How to print the taken inputs?
so now lets start with the Step 1:
(Print Info on Screen)
1. open the notepad
2. type/copy the following code
////////////////////////////////////
public class myprogram {
public static void main(String args[])
{
System.out.println("Hi...!!! Welcome to my First Program in Java...");
}
}
///////////////////////////////////
3. now save the code to the
>>> C:\Program Files\Java\jdk1.6.0_06\bin
(The place where your JDK is installed {above is the dafault location} )
NOTE:
in the above pic when i type the name of program, it is the same name as the name of my class in the code..
and i have type "" double quotes and in them i type "myprogram.java"
now save it.
4. Now lets Compile and run the code
Open Run from Start Menu (or Shortcut key "win+R")
and type
CMD
hit enter, and goto the following location
C:\Program Files\Java\jdk1.6.0_06\bin
by typing as the following picture
then compile and run the code
In the above pic
To compile the code:
we type
>> javac myprogram.java (hit Enter)
then execute the compiles program
>> java myprogram (hit enter)
////////////////////////////////
from the above, I think u people now print any text on the screen
just edit the
>>System.out.println("Hi...!!! Welcome to my First Program in Java...");
line and thats it...