Question: What will the following program print when compiled and run? Select the one correct answer. (a) The program will not compile. (b) The program will
What will the following program print when compiled and run?

Select the one correct answer.
(a) The program will not compile.
(b) The program will compile, and print true when run.
(c) The program will compile, and print false when run.
(d) The program will compile, and throw an exception when run.
// File: HouseC interface ISwitch { default boolean ison () { return false; } } class Light implements ISwitch { boolean ison () { return true; } } public class HouseC{ public static void main(String[] args) { ISwitch light switch = new Light (); System.out.println (lightswitch.ison ()); } } // (1) // (2)
Step by Step Solution
3.43 Rating (153 Votes )
There are 3 Steps involved in it
a The program will not compile because the o... View full answer
Get step-by-step solutions from verified subject matter experts
