Advertisement
Sajib_Ahmed

Untitled

Mar 2nd, 2019
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1.  
  2. package javaapplication8;
  3.  
  4.  
  5. public class Customar {
  6.  
  7. private String CustomarId;
  8. private String Password;
  9.  
  10. public Customar(String CustomarId, String Password) {
  11. this.CustomarId = CustomarId;
  12. this.Password = Password;
  13. }
  14. public void display()
  15. {
  16. System.out.println("Customer ID :"+CustomarId);
  17. System.out.println("Password :"+Password);
  18. }
  19.  
  20.  
  21.  
  22. }
  23.  
  24. package javaapplication8;
  25.  
  26.  
  27. public class ItemType {
  28. private String ItemId;
  29. private double price;
  30.  
  31. public ItemType(String ItemId, double price) {
  32. this.ItemId = ItemId;
  33. this.price = price;
  34. }
  35. public void display()
  36. {
  37. System.out.println("Item ID: "+ItemId);
  38. System.out.println("Pric :"+price);
  39. }
  40.  
  41.  
  42. }
  43.  
  44. package javaapplication8;
  45.  
  46. public class BuyItem {
  47. private String Buydata;
  48. private int quantity;
  49.  
  50. public BuyItem(String Buydata, int quantity) {
  51. this.Buydata = Buydata;
  52. this.quantity = quantity;
  53. }
  54. public void display()
  55. {
  56. System.out.println("Buydata :"+Buydata);
  57. System.out.println("Quantity :"+quantity);
  58. }
  59.  
  60.  
  61.  
  62. }
  63.  
  64. package javaapplication8;
  65.  
  66.  
  67. public class Main extends BuyItem {
  68.  
  69. public Main() {
  70. super("Hot", 100);
  71. }
  72.  
  73. public static void main(String[] args)
  74. {
  75.  
  76.  
  77. Customar obj1=new Customar("Hunter","Fuck you");
  78. obj1.display();
  79.  
  80. ItemType obj2=new ItemType("kkkkk",200.00);
  81. obj2.display();
  82. Main obj=new Main();
  83. obj.display();
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90. }
  91.  
  92. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement