✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
If we had the following implementations:
public interface InterfaceA {
public void printLetter();
}
public class ClassB implements InterfaceA {
@Override public void printLetter() { System.out.println("B"); }
}
public class ClassC implements InterfaceA {
@Override public void printLetter() { System.out.println("C"); }
}
If we intialize the following variable:Interface a = new ClassB();ClassB b = new ClassB();ClassC c = new ClassC();Are these valid usage of casting?ClassB b2 = (ClassB) a;InterfaceA a2 = (InterfaceA) c;