Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Created by Inan on 18/03/2018.
- */
- public class Playlist {
- private int n;
- private Song [] songs;
- Playlist(int amount){
- this.songs = new Song[amount];
- this.n = 0;
- }
- Playlist( , double length){
- }
- public void add(Song song){
- songs[n] = song;
- n++;
- }
- double getLaenge(){
- double sum = 0;
- for (int i = 0; i <= n-1 ; i++) {
- sum = sum + songs[i].getLaenge();
- }
- return sum;
- }
- public void print(){
- for (int i = 0; i <= n-1 ; i++) {
- songs[i].print();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement