Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package javaapplication8;
- public class Customar {
- private String CustomarId;
- private String Password;
- public Customar(String CustomarId, String Password) {
- this.CustomarId = CustomarId;
- this.Password = Password;
- }
- public void display()
- {
- System.out.println("Customer ID :"+CustomarId);
- System.out.println("Password :"+Password);
- }
- }
- package javaapplication8;
- public class ItemType {
- private String ItemId;
- private double price;
- public ItemType(String ItemId, double price) {
- this.ItemId = ItemId;
- this.price = price;
- }
- public void display()
- {
- System.out.println("Item ID: "+ItemId);
- System.out.println("Pric :"+price);
- }
- }
- package javaapplication8;
- public class BuyItem {
- private String Buydata;
- private int quantity;
- public BuyItem(String Buydata, int quantity) {
- this.Buydata = Buydata;
- this.quantity = quantity;
- }
- public void display()
- {
- System.out.println("Buydata :"+Buydata);
- System.out.println("Quantity :"+quantity);
- }
- }
- package javaapplication8;
- public class Main extends BuyItem {
- public Main() {
- super("Hot", 100);
- }
- public static void main(String[] args)
- {
- Customar obj1=new Customar("Hunter","Fuck you");
- obj1.display();
- ItemType obj2=new ItemType("kkkkk",200.00);
- obj2.display();
- Main obj=new Main();
- obj.display();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement