-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContact.java
51 lines (38 loc) · 1.13 KB
/
Contact.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
47
48
49
50
51
public class Contact{
public static void main(String[] args){
String aah = SaloonMethod.service("haircut");
System.out.println("The service is = "+ aah);
int price1 =1;
System.out.println("The price is in main class = $ "+ price1);
}
public class name{
public static String service(String saloonService){
int price =0;
System.out.println("The mobile number is = $ "+ price); // explicit call of variable
if (saloonService == "anjan"){
return "Haircut";
}
if (saloonService == "ravi"){
return "Hair Color";
}
if (saloonService == "sahil"){
return "Spa";
}
if (saloonService == "dhruva"){
return "Facial";
}
if (saloonService == "karthik"){
return "Pedicure";
}
if (saloonService == "tarun"){
return "tarun";
}
if (saloonService == "shashank"){
return "shashank";
}
// int price =1;
// System.out.println("The price is = $ "+ price); // explicit call of variable will NOT WORK cause if condition satisfies it exits loop
return "please select a valid service";
}
}
}