Advertisement
Guest User

Item

a guest
Dec 11th, 2019
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. public class Item {
  2.  
  3.     public String name;
  4.     public int itemNumber;
  5.     public int qty;
  6.     public double price;
  7.     public Item next;
  8.  
  9.     public Item(String name, int itemNumber, int qty, double price) {
  10.  
  11.         this.name = name;
  12.         this.itemNumber = itemNumber;
  13.         this.qty = qty;
  14.         this.price = price;
  15.     }
  16.  
  17.     public void displayItem() {
  18.  
  19.         System.out.println(name + " " + itemNumber + " " + qty + " " + price);
  20.         System.out.println();
  21.     }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement