Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Test {
- public static void main(String[] args) {
- // Create Juice object
- Juice m1 = new Juice("Fresh Juice 1", 30, "pineapple");
- // Create Pasta object
- String[] ingredients = {"pasta", "tomato", "olives", "cheese", "nuts"};
- Pasta m2 = new Pasta("Pasta Primavera", 70, false, ingredients);
- // Check if both are served hot
- if (m1.isServedHot() || m2.isServedHot()) {
- System.out.println("Need hot gloves!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment