Kérdés: Given the following Java code: class Dog { } class…

en Normál / Egy választás / 100% / 0% / 0%
Given the following Java code: class Dog { } class Spaniel extends Dog { } class DogTest { public static void main(String [] args) { Dog d1 = new Dog(); Spaniel h1 = new Spaniel(); Dog d2 = h1; Spaniel h2 = (Spaniel) d2; Spaniel h3 = (Spaniel) d1; } } What happens when we compile and run this code?
A perc kérdése