Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From test class {
- User userTest = new User();
- userTest.setUserId("Daniel");
- Bid bid = new Bid();
- bid.setBidId(3);
- bid.setBidder(userTest);
- System.out.println("Bid: " + bid.getBidId() + " has a user of: " + bid.getUserId() );
- }
- public class User {
- //private String bidrate;
- // Class User. A user has an identifier, a rating, and an array of
- //items purchased in auctions.
- private String biduser;
- //private int bidrating;
- private int totalrating;
- public String getUserid()
- { return getBiduser();
- }
- public void setUserid(String id)
- { setBiduser(id);
- }
- public void addRating(int rating)
- { totalrating = rating + totalrating;
- }
- public int getRating()
- { return totalrating;
- }
- public void setBiduser(String biduser) {
- this.biduser = biduser;
- }
- public String getBiduser() {
- return biduser;
- }
- }
- public class Bid {
- //private String bidder;
- private int bidAmount;
- private int Bidid;
- private int totalbidamount;
- private String totalbidder;
- private User bidder = new User();
- //return the value
- public User getBidder()
- { return bidder;
- }
- public void setBidder(User u)
- { bidder.setUserid(u);
- }
- // returns the value
- public int getBidId() {
- return Bidid; }
- // sets the value
- public void setBidId(int id) {
- Bidid = id;
- }
- public int getBidAmount()
- { return bidAmount ;
- }
- public void setBidAmount(int amount)
- { bidAmount = amount;
- }
Add Comment
Please, Sign In to add comment