-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexp4b.java
More file actions
33 lines (33 loc) · 865 Bytes
/
exp4b.java
File metadata and controls
33 lines (33 loc) · 865 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
33
import java.util.*;
class Main {
Main(String name){
System.out.println("The name of candidiate is : "+name);
}
Main(String name,String city){
System.out.println("The name of candidiate is : "+name+" and resites in City"+city);
}
Main(String name,String city, int phone){
System.out.println("The name of candidiate is : "+name+" and resites in City " +city+ "
Contact given is "+phone);
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Name: Saachi Kokate \n Roll no.: 50 \n Div: S13");
System.out.println("Enter Required Details : \n 1.NAME\n2. NAME & CITY\n 3. NAME, CITY
& PHONE NO.");
int details= sc.nextInt();
switch (details) {
case 1:
new Main("NIKI");
break;
case 2:
new Main("NIKI","MUMBAI");
break;
case 3:
new Main("NIKI","MUMBAI",992233440);
break;
default:
break;
}
}
}