Ask Question
8 October, 01:22

Write the definition of a class PlayListEntry containing: An instance variable title of type String, initialized to the empty String. An instance variable artist of type String, initialized to the empty String. An instance variable playCount of type int, initialized to 0. In addition, your PlayList class definition should provide an appropriately named "get" method and "set" method for each of these. No constructor need be defined.

+4
Answers (1)
  1. 8 October, 04:08
    0
    public class PlayListEntry {

    string title="";

    string artist="";

    int playCount=0;

    void SetTitle (string title) {

    this. title=title;

    }

    string GetArtist () {

    return this. artist;

    }

    void SetArtist (string artist) {

    this. artist=artist;

    }

    int GetplayCount () {

    return this. playCount;

    }

    void SetplayCount (int playCount) {

    this. playCount = playCount;

    }

    }

    Explanation:

    Here in above class we are taking instance variables and assigning them in set methods and returning them in get methods
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write the definition of a class PlayListEntry containing: An instance variable title of type String, initialized to the empty String. An ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers