Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. package oop.PizzaModified;
  2.  
  3. public class Pizza {
  4. // Private properties
  5. private int price;
  6. private String type;
  7.  
  8. // Constructs a Pizza object with a price and a type
  9. public Pizza(int price, String type) {
  10. this.price = price;
  11. this.type = type;
  12. }
  13.  
  14. // Gets the price of the pizza
  15. public int price() {
  16. return price;
  17. }
  18.  
  19. // Gets the type of the pizza
  20. public String type() {
  21. return type;
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement