When we write a java program .. it is saved with the file name ClassName.java(Make sure the extension is .java. the Classname.java file is compiled using the java compliler..
If the file complies successfully then a class file of the same name (Classname.class) will be generated.then the generated class file is executed .
SO lets start with the official "Hello world program"
Hello World Program
class HelloWorld //Declare name of the main class, first lettershould becapital{
public static void main(String arg[]])
{
System.out.println("Hello world"); //Prints output on the screen
System.out.print("Welcome to Codsters, Clear your concepts and logics");
}
}