public class Song extends MusicalElement{ private static final long serialVersionUID = 2112880640160601826L; private String artist, genre; public Song(String title, int duration, String content, String artist, Genre genre) { super(title, duration, content); this.artist=artist; this.genre=genre.name(); } public String getArtist(){return artist;} public String getGenre(){return genre;} public void setArtist(String artist){this.artist=artist;} public void setGenre(Genre genre){this.genre=genre.name();} public String toString() { return "Id : "+getId()+"\nTitle : "+getTitle()+"\nDuration : "+getDuration()+"\nContent : "+getContent()+"\nArtist : "+getArtist()+"\nGenre : "+getGenre(); // return getTitle()+";"+getDuration()+";"+getContent()+";"+getArtist()+";"+getGenre(); } /* public static void save(){ String filename="songs.csv"; try { //Saving of object in a file FileOutputStream file = new FileOutputStream(filename); ObjectOutputStream out = new ObjectOutputStream(file); // Method for serialization of object out.writeObject(this); out.close(); file.close(); System.out.println("Object has been serialized"); } catch(IOException ex) { System.out.println("IOException is caught"); } }*/ }