Kizspy.me
- name: String
numberOfSongs: int
Singer()
+ Singer(singerId: int, name: String,
numberOfSongs: int)
+ setters & getters
+ toString(): String
numberOfSongs:
int)
parameterized
constructor, which sets values to singerld, name,
numberOfSongs.

setters & getters: write the setters and getters of
the fields.

toString(): String - returns a string format that
contains all the information of the Singer:
singerld, name, numberOfSongs.
Write a class SingerList which extends from ArrayList (ArrayList is a collection) with the following
information:
SingerList
+ getSingerById(id: int): Singer
+countSingersByNumberOfSongs(value: int):
int
Where:

getSingerById(id: int): Singer - returns
the Singer associated with the specified
id. If there is no Singer in the list whose
singerld matches the id, it returns null
value.

countSingersByNumberOfSongs(value:
int): int returns the count of singers
with the number of songs greater than or
equal to value
Hints: to declare the SingerList class, you can use the following statement:
public class SingerList extends ArrayList<Account> { //.....}
The program output might look something like this (using the SingerList class):
Zoom
+100%
Close