Package bookstore

Class CD

java.lang.Object
bookstore.CD

public class CD extends Object
Represents a CD
  • Constructor Details

    • CD

      public CD(String name, String artist, double price, int stock)
      Constructor for CD class
      Parameters:
      name - the name or title of the product
      artist - artist or band name as a String
      price - the price of the product
      stock - the amount of this product currently in stock
  • Method Details

    • getArtist

      public String getArtist()
      Gets the value of the artist field.
      Returns:
      the artist or band's name
    • setArtist

      public void setArtist(String artist)
      Assigns the given value to the artist field
      Parameters:
      artist - the artist or band's name
    • getName

      public String getName()
      Gets the value of the name field
      Returns:
      the value of name
    • setName

      public void setName(String name)
      Assigns the given value to the name field
      Parameters:
      name - the name
    • getPrice

      public double getPrice()
      Gets the value of the price field
      Returns:
      the value of price
    • setPrice

      public void setPrice(double price)
      Assigns the given value to the price field
      Parameters:
      price - the price
    • getStock

      public int getStock()
      Gets the value of the stock field
      Returns:
      the value of stock
    • setStock

      public void setStock(int stock)
      Assigns the given value to the stock field
      Parameters:
      stock - the stock