Now we are going to write our first program , So just open any text editor or you can use Dreamweaver also to write Java program.
Step 1 : So just write this:
1 2 3 4 5 6 | public class demo { public static void main (String[]args) { System.out.println("Hello Java!"); } } |
Now save this file with .java extension e.g. demo.java at any location/Folder. For example you save file in ‘D’ drive ‘java-test’ Folder ‘demo.java’. D:\java-test\demo.java
Step 2 : Now run ‘cmd’ : press window+R and type cmd and enter. Command prompt will open.
Step 3 : Now change folder location in cmd so java file can run so just type drive name e.g.
C:\Users\vipulrai>d:
Step 4 : Go to Folder ‘java-test’ in cmd