-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwelcome.java
More file actions
32 lines (22 loc) · 831 Bytes
/
welcome.java
File metadata and controls
32 lines (22 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//Write a program to input from user and display eg.Welcome (name)
//Import module util
import java.util.*;
//give a class name
public class welcome {
public static void main(String[] args) {
//String function can contain keyword
String name;
Scanner sc=new Scanner(System.in);
System.out.println("May I know your Name: ");
//The nextLine() method of java.util.Scanner class advances this scanner past the current line and returns the input that was skipped.
name=sc.nextLine();
System.out.println("Welcome "+name);
}
}
///////////////Output////////////////
//May I know your Name: //
//to you on my github page //
//Welcome to you on my github page //
/////////////////////////////////////
//Thanks you
//bye