-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVideoGame.java
62 lines (50 loc) · 1.27 KB
/
VideoGame.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
61
62
package arraylistexample;
public class VideoGame {
private String title;
private int year;
private String rating;
private String[] platforms;
public VideoGame() {
}
public VideoGame(String title, int year, String rating, String[] platforms) {
this.title = title;
this.year = year;
this.rating = rating;
this.platforms = platforms;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public int getYear() {
return year;
}
public void setYear(int year) {
this.year = year;
}
public String getRating() {
return rating;
}
public void setRating(String rating) {
this.rating = rating;
}
public String[] getPlatforms() {
return platforms;
}
public void setPlatforms(String[] platforms) {
this.platforms = platforms;
}
@Override
public String toString()
{
String result = "";
result += "\nTitle: "+ getTitle() + "\nYear: "+getYear()+
"\nRating: "+getRating()+"\nPlatforms: ";
for (String platform : getPlatforms()) {
result += platform + " ";
}
return result;
}
}