Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Created by ltnb on 7/18/17.
- */
- public class Songplayer extends Song{
- public Songplayer(String name, double duration, String lyrics) {
- super(name, duration, lyrics);
- }
- public static void main(String[] args) {
- Album album = new Album("Shironamhin","Bondho Janala");
- Song s1 = new Song("Tuhin", 4, "Sara bela bondho janala");
- album.addToAlbum(s1);
- s1 = new Song("Tuhin, Zia", 4.2, "Megh jhore jhore bristy naame");
- album.addToAlbum(s1);
- s1 = new Song("Tuhin", 4.3, "TSC er chottor, bullet kingba kobita");
- album.addToAlbum(s1);
- System.out.println("Album Info");
- System.out.println(album.getInfo());
- obj.printSongList();
- }
- }
- class Album {
- public Album(String BandName, String AlbumName){
- BandName = BandName;
- AlbumName = AlbumName;
- }
- public void addToAlbum(Song s1) {
- }
- }
- class Song {
- public String name, lyrics;
- public double duration;
- public Song(String name, double duration, String lyrics) {
- this.name = name;
- this.lyrics = lyrics;
- this.duration = duration;
- }
- public static void play(Song s1) {
- System.out.println(s1.lyrics);
- }
- public String getInfo() {
- System.out.printf("Song{Singer Name: %s , duration = %.2f }", name, duration);
- return " ";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement