What happens after the following code is compiled and run:

01: interface TheInterface {
02:    void print();
03: }
04: 
05: class TheClass implements TheInterface {
06:    public void print() {
07:       System.out.println("TheClass");
08:    }
09: }
10: 
11: public class ClassConversion {
12:    public static void main(String[] args) {
13:       TheClass c = new TheClass();
14:       TheInterface i = c;
15:       i.print();
16:    }
17: }

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
Java quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes