Package bookstore

Class Book

java.lang.Object
bookstore.Book

public class Book extends Object
Represents a book
  • Constructor Details

    • Book

      public Book(String name, String author, double price, int stock)
      Book constructor
      Parameters:
      name - the book's title
      author - the author of the book
      price - the price of the book
      stock - number of copies in stock
  • Method Details

    • getAuthor

      public String getAuthor()
      Gets the value of the author field
      Returns:
      the value of author
    • setAuthor

      public void setAuthor(String author)
      Assigns the given value to the author field
      Parameters:
      author - the author
    • 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