import java.io.*;// I/O package imported.
public class Welcome{ //class name is "Welcome"
public Welcome(){ //constructor declaired to print the message.
System.out.println("Welcome to Java Programming Language!");/* System.out.println is used for output.
Welcome Message is written within " ".*/
}//display() closes here.
public static void main(String[] args){ //main() is declaired to declair an object in it.
Welcome obj=new Welcome(); //Object "Obj" is bean created.
}//main() closes.
}//class "Welcome" ends here.
Above program displays the message which is written by you in " ". In programs "/*" and "*/" are use for multiple line comment(s) and "//" is use for single line comment. Code line "Welcome obj=new Welcome();" is use to create an object.
public class Welcome{ //class name is "Welcome"
public Welcome(){ //constructor declaired to print the message.
System.out.println("Welcome to Java Programming Language!");/* System.out.println is used for output.
Welcome Message is written within " ".*/
}//display() closes here.
public static void main(String[] args){ //main() is declaired to declair an object in it.
Welcome obj=new Welcome(); //Object "Obj" is bean created.
}//main() closes.
}//class "Welcome" ends here.
Above program displays the message which is written by you in " ". In programs "/*" and "*/" are use for multiple line comment(s) and "//" is use for single line comment. Code line "Welcome obj=new Welcome();" is use to create an object.
Comments