-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDay_23_c_constructor_challenge.java
More file actions
36 lines (29 loc) · 1.03 KB
/
Copy pathDay_23_c_constructor_challenge.java
File metadata and controls
36 lines (29 loc) · 1.03 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
package Programing.Section6;
public class Day_23_c_constructor_challenge {
private String Name;
private double credit_limit;
private String email_address;
public Day_23_c_constructor_challenge(){
this("Empty name's",999,"xyz@gmail.com");
System.out.println("empty constructed is called");
}
public Day_23_c_constructor_challenge(String name, double credit_limit){
this(name,credit_limit,"idontknow@gmail.com");
System.out.println("two field constructed is called");
}
public Day_23_c_constructor_challenge(String name, double credit_limit, String email_address) {
this.Name = name;
this.credit_limit = credit_limit;
this.email_address = email_address;
System.out.println("all field constructed is called");
}
public String getName() {
return Name;
}
public double getCredit_limit() {
return credit_limit;
}
public String getEmail_address() {
return email_address;
}
}