-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcust.java
More file actions
42 lines (40 loc) · 739 Bytes
/
cust.java
File metadata and controls
42 lines (40 loc) · 739 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
34
35
36
37
38
39
40
41
42
class cust{
private static int id=1000;
private int custid;
private String customerName;
public cust(){
custid=id++;
customerName="default";
}
public cust(int custid,String custName){
this.custid=custid;
customerName=custName;
id++;
}
public void setcustName(String customerName){
this.customerName=customerName;
}
public String getcustName(){
return customerName;
}
public void setdata(int id){
custid=id;
}
public int getdata(){
return custid;
}
public int gettotal(){
return id-1000;
}
public boolean validateName(){
if(customerName.length()>3 && customerName.length()<20){
return true;
}
else{
return false;
}
}
public void display(){
System.out.println("Cust called");
}
}