1- Assume there is a class AirConditioner that supports the following behaviors:
ID: 3527047 • Letter: 1
Question
1- Assume there is a class AirConditioner that supports the following behaviors: turning the air conditioner on and off. The following methods are provide this behavior: turnOn and turnOff . Both methods take no arguments and return no value. Assume there is a reference variable myAC to an object of this class, which has already been created. Using the reference variable, invoke a method to tell the air conditioner object to turn on.So, as a result of your code executing, the turnOn() method of the AirCondition object that myAC refers to will be invoked.Explanation / Answer
} public static void officeAC() { AirConditioner officeAC = new AirConditioner(true, 69); // other expressions you want for officeAC }
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.