Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package oop.PizzaModified;
- public class Pizza {
- // Private properties
- private int price;
- private String type;
- // Constructs a Pizza object with a price and a type
- public Pizza(int price, String type) {
- this.price = price;
- this.type = type;
- }
- // Gets the price of the pizza
- public int price() {
- return price;
- }
- // Gets the type of the pizza
- public String type() {
- return type;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement