-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.java
46 lines (41 loc) · 1.34 KB
/
Main.java
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scanner = new Scanner(System.in);
System.out.println("1- sms");
System.out.println("2- Email");
System.out.println("0- Exit");
int option;
//scanner.close();
do {
System.out.println("--------------------------");
System.out.println("Enter the option: ");
option = scanner.nextInt();
switch (option) {
case 1:
// SMS
System.out.println("Enter moblie number and message : ");
String dummy= scanner.nextLine();
Sms<String, String> generic1 = new Sms<>(scanner.nextLine(), scanner.nextLine());
System.out.println("Phone Number: " + generic1.getA());
System.out.println("SMS: " + generic1.getB());
break;
case 2:
// EMAIL
String dummy1= scanner.nextLine();
System.out.println("Enter Email id and message : ");
Sms<String, String> generic2 = new Sms<>(scanner.nextLine(), scanner.nextLine());
System.out.println("Email Id: " + generic2.getA());
System.out.println("Content of the Mail: " + generic2.getB());
break;
case 0:
System.out.println("byee Exited!!!");
break;
default:
System.out.println("Enter the correct option----->");
}
} while (option != 0);
scanner.close();
}
}