Question: Create a public static Boolean field named detailedMode and initialize detailedMode with true. Ex: If the input is milk cream cheese, then the output is:
Create a public static Boolean field named detailedMode and initialize detailedMode with true.
Ex: If the input is milk cream cheese, then the output is:
The ordered food is milk.
The ordered food is cream.
Order: cheese public class Order
Your code goes here
private String food;
public OrderString newFood
food newFood;
public void print
if detailedMode
System.out.printlnThe ordered food is food ;
else
System.out.printlnOrder: food;
NewOrders.java: import java.util.Scanner;
public class NewOrders
public static void mainString args
Scanner scnr new ScannerSystemin;
Order order new Orderscnrnext;
Order order new Orderscnrnext;
Order order new Orderscnrnext;
orderprint;
orderprint;
Order.detailedMode false;
orderprint;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
