Java Hello world example


Step 1:

        Open a notepad or any text editor and type the below program

public class Sample 
{
	public static void main(String[] args) 
	{

		System.out.println("Welcome to candidjava.com");

	}

}

Save the file as Sample.java (class name.java)


Step 2

        Open a new cmd prompt and locate the java file where it is saved.

compile using javac sample.java, you can see a .class file generated in the same loacation

Run using java Sample (java classname)





Related Post

Comments

jsjjs
         Jdjdjdjdjj

©candidjava.com