-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEComm.java
More file actions
93 lines (65 loc) · 1.74 KB
/
Copy pathEComm.java
File metadata and controls
93 lines (65 loc) · 1.74 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
package JavaSessions;
public class EComm {
// method overloading:
// within the same class when we have diff methods:
// 1. with the same name
// 2. with different types and number of parameters
// 3. the sequence of the params should be different
// Compile (static)(early binding) poly+morphism --> differnt forms -->
// public void login() {//0
// System.out.println("login");
// }
//
// public void login(int a) {//1
// System.out.println("login " + a);
// }
//
// public void login(int a, int b) {//2
// System.out.println("login " + a + b);
// }
//
// public void login(int a, String b) {//2
// System.out.println("login " + a + b);
// }
//
// public String login(String a, int b) {//2
// System.out.println("login " + a + b);
// return a+b;
// }
public void login() {
System.out.println("default login");
}
public void login(String un, String pwd) { // parameters
System.out.println("login with : " + un + pwd);
}
public void login(String un, String pwd, String role) {
System.out.println("login with : " + un + pwd + role);
}
public void login(String un, String pwd, int otp) {
System.out.println("login with : " + un + pwd + otp);
}
public void login(long ph, int otp) {
System.out.println("login with : " + ph + otp);
}
//
public void search() {
}
public void search(String name) {
}
public void search(String name, int price) {
}
public void search(String name, String sellerName) {
}
//
public void booking() {
}
public void booking(String carType, String from, String to) {
}
public void booking(String carType, String from, String to, int users) {
}
//payment
public static void main(String[] args) {
EComm obj = new EComm();
obj.login("admin", "admin123");// arguments
}
}