1st Program of Java-

 public class Test{ 

public static void main (String args[]) 

{   

System.out.println("welcome"); 


This is simple which will give the output -

'Welcome' 


Terms-  

String args[]

As we know that in java the input will be in String format. That's why in main method the parameter will be passed as String to take input.

println -  

here ln is used for next line unlike c we need to give escape sequence(\n) for new line. 




Comments