-
Notifications
You must be signed in to change notification settings - Fork 1
/
Song.java
60 lines (50 loc) · 1.21 KB
/
Song.java
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import java.util.Date;
//Class outline for songs
public class Song {
private String name;
private String artist;
private String genre;
private int length;
//Constructor with parameters of name and length
public Song(String name, int length) {
this.name = name;
this.length = length;
this.artist = "No Artist Set";
this.genre = "No Genre Set";
}
//Constructor with parameters of name and length and artist and genre
public Song(String name, int length, String artist, String genre) {
this.name = name;
this.length = length;
this.artist = artist;
this.genre = genre;
}
//Returns name of Song
public String getName() {
return this.name;
}
//Returns Artist of Song
public String getArtist() {
return this.artist;
}
//Sets Artist of Song
public void setArtist(String artist) {
this.artist = artist;
}
//Returns Genre of song
public String getGenre() {
return this.genre;
}
//Sets Genre of Song
public void setGenre(String genre) {
this.genre = genre;
}
//Returns length of song
public int getLength() {
return this.length;
}
//toString Method of Song
public String toString() {
return this.name;
}
}