Consider the code below. What will be output to the console? class A { public void foo() { System.out.println("I am A");
Posted: Mon May 02, 2022 11:47 am
Consider the code below. What will be output to the console? class A { public void foo() { System.out.println("I am A"); } } class B C public void food) { System.out.println("I am B"); 1 public void also() { System.out.println("I am also B"); 3 3 public class Example public static void main(String[largs) { A myObject = new B(); myObject.foo(); 3 3