What will be the output of the program?


			  		

Loading

Choose the correct option.

What will be the output of the program?

public class HorseTest {     
public static void main (String [] args) {
class Horse {
public String name; /* Line 7 */
public Horse(String s) {
name = s;
}
} /* class Horse ends */
Object obj = new Horse("Zippo"); /* Line 13 */
Horse h = (Horse) obj; /* Line 14 */
System.out.println(h.name);
}
} /* class HorseTest ends */

 

A. An exception occurs at runtime at line 10.
B. It prints “Zippo”.
C. Compilation fails because of an error on line 7.
D. Compilation fails because of an error on line 13.