Question
Is this correct(and efficient) code and if not can you please correct and explain why. These are the requirements i'm following so base your responses
Is this correct(and efficient) code and if not can you please correct and explain why. These are the requirements i'm following so base your responses on it too
code java//
public class main {
public static void main(String[] args) { restaurant hi= new restaurant(); hi.serveCheeseBurger(9); System.out.println(); // TODO Auto-generated method stub
}
}
public class OutOfStock extends Exception { }
public class restaurant { private String name; private int order; private int stock=6;
public void setName() { this.name=name; } String getName() { return name; } void serveCheeseBurger(int order){ //if(stockUp==0) { try { for(int i=0; i } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started