Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *
- * @author MUHAMMAD AZRI BIN JASNI @ ABDUL RANI
- * @version (a version number or a date)
- */
- public class Handphone
- {
- //declaration of data
- private String sn;
- private String brand;
- private double price;
- public Handphone(String sn, String brand, double price)
- {
- this.sn = sn;
- this.brand = brand;
- this.price = price;
- }
- public String getSN(){
- return sn;
- }
- public String getBrand(){
- return brand;
- }
- public double getPrice(){
- return price;
- }
- public String toString(){
- //...
- return getSN() + "\t\t" + getBrand() + "\t" + getPrice() + "\t";
- } //to display output
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement