Java Program to Print personalised greeting message

Write a Java program for asking for user for their name and then prints a personalised greeting message.



Source Code
import java.util.Scanner;

public class UserGreeting {

	public static void main(String[] args) {
		
		Scanner s = new Scanner(System.in);
		System.out.print("Enter ur name : ");
		String name = s.nextLine();
		System.out.println("Welcome, "+name);
	}
}
Output
Enter ur name : Rahul
Welcome, Rahul