forked from janbodnar/Java-Advanced
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParrot.java
More file actions
37 lines (29 loc) · 794 Bytes
/
Parrot.java
File metadata and controls
37 lines (29 loc) · 794 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
package com.zetcode;
public class Parrot implements Pet {
private String name;
private String species;
public Parrot(String name, String species) {
this.name = name;
this.species = species;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSpecies() {
return species;
}
public void setSpecies(String species) {
this.species = species;
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("Parrot{");
sb.append("name='").append(name).append('\'');
sb.append(", species='").append(species).append('\'');
sb.append('}');
return sb.toString();
}
}