-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPerson.java
More file actions
31 lines (28 loc) · 720 Bytes
/
Copy pathPerson.java
File metadata and controls
31 lines (28 loc) · 720 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
package chapter11.eight;
public class Person {
public final String first;
public final String last;
public final String address;
public Person(String first,String last,String address) {
this.first=first;
this.last=last;
this.address=address;
}
@Override
public String toString() {
// TODO Auto-generated method stub
return "Person:"+first+" "+last+" "+address;
}
public static class NullPerson extends Person implements Null{
public NullPerson() {
super("none", "none", "none");
// TODO Auto-generated constructor stub
}
@Override
public String toString() {
// TODO Auto-generated method stub
return "NullPerson";
}
public static final Person NULL=new NullPerson();
}
}