Guest User

Class and Object

a guest
Oct 22nd, 2020
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.82 KB | None | 0 0
  1. /**
  2.  * A class that models an auction bid.
  3.  *
  4.  * @author (Fika Nur Aini)
  5.  * @version (22 October 2020)
  6.  */
  7. public class Bid
  8. {
  9.    // The person making the bid  
  10.    private final Person bidder;  
  11.    // The value of the bid. This could be a large number so the long type has been used  
  12.    private final long value;  
  13.    /**  
  14.     * Create a bid  
  15.     * @param bidder Who is bidding for the lot.  
  16.     * @param value The value of the bid.  
  17.     */  
  18.    public Bid(Person bidder, long value)  
  19.    {  
  20.      this.bidder = bidder;  
  21.      this.value = value;  
  22.    }  
  23.    /**  
  24.     *@return The bidder.  
  25.     */  
  26.    public Person getBidder()  
  27.    {  
  28.      return bidder;  
  29.    }  
  30.    /**  
  31.     * @return The value of the bid.  
  32.     */  
  33.    public long getValue()  
  34.    {  
  35.      return value;  
  36.    }  
  37. }  
  38.    
Advertisement
Add Comment
Please, Sign In to add comment