public class Song {
protected String name;
protected String composer;
protected int year;
public Song(String name, String composer, int year) {
this.name = name;
this.composer = composer;
this.year = year;
}
public Song(String name){
this.name = name;
}
@Override
public String toString() {
return "Song{" +
"name='" + name + '\'' +
", composer='" + composer + '\'' +
", year=" + year +
'}';
}
public String toString(int year) {
String yearN = String.valueOf(year);
return "Song{" +
"name='" + name + '\'' +
", composer='" + composer + '\'' +
", year=" + yearN +
'}';
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getComposer() {
return composer;
}
public void setComposer(String composer) {
this.composer = composer;
}
public int getYear() {
return year;
}
public void setYear(int year) {
this.year = year;
}
}