Advertisement
shad0wk1

Lab Exercise 5 Queue Handphone Class

Oct 20th, 2012
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.73 KB | None | 0 0
  1.  
  2. /**
  3.  *
  4.  * @author MUHAMMAD AZRI BIN JASNI @ ABDUL RANI
  5.  * @version (a version number or a date)
  6.  */
  7. public class Handphone
  8. {
  9.     //declaration of data
  10.     private String sn;
  11.     private String brand;
  12.     private double price;
  13.  
  14.     public Handphone(String sn, String brand, double price)
  15.     {
  16.         this.sn = sn;
  17.         this.brand = brand;
  18.         this.price = price;
  19.     }
  20.    
  21.     public String getSN(){
  22.         return sn;
  23.     }
  24.    
  25.     public String getBrand(){
  26.         return brand;
  27.     }
  28.    
  29.     public double getPrice(){
  30.         return price;
  31.     }
  32.    
  33.     public String toString(){
  34.         //...
  35.         return getSN() + "\t\t" + getBrand() + "\t" + getPrice() + "\t";
  36.     } //to display output
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement