1) Run Cmd.
2) Type: cd \
3) Type: mkdir learnjava
4) Type: cd learnjava
5) Type: mkdir 101
6) Type: cd 101
7) Type: edit Hello.java
1) Type the following codes:
/*
* First Java program to say Hello
*/
public class Hello { //save as "Hello.java"
public static void main(String[] args) {
System.out.println("Hello, world!");
}
}
2) Save and Exit Text Editor
1) Type: javac Hello.java
2) Type: java Hello
No comments:
Post a Comment