Iam_Sandeep

Untitled

May 9th, 2023
903
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. public class Test {
  2.   public static void main(String[] args) {
  3.     // Create Juice object
  4.     Juice m1 = new Juice("Fresh Juice 1", 30, "pineapple");
  5.  
  6.     // Create Pasta object
  7.     String[] ingredients = {"pasta", "tomato", "olives", "cheese", "nuts"};
  8.     Pasta m2 = new Pasta("Pasta Primavera", 70, false, ingredients);
  9.  
  10.     // Check if both are served hot
  11.     if (m1.isServedHot() || m2.isServedHot()) {
  12.       System.out.println("Need hot gloves!");
  13.     }
  14.   }
  15. }
  16.  
Advertisement
Add Comment
Please, Sign In to add comment