Saturday, May 11, 2019

what will be the output of the following code?

Problem statement:
what will be the output of the following code?
  1. class ExecutionTwelve {
  2.     public void talk() {
  3.         System.out.println("I'm a ExecutionTwelve !");
  4.     }
  5. }
  6. class ExecutionThirteen extends ExecutionTwelve {
  7.     @Override
  8.     public void talk() {
  9.         System.out.println("I'm a ExecutionThirteen !");
  10.     }
  11. }
  12. public class ExecutionEleven {
  13.     public static void main(String[] args) {
  14.         ExecutionTwelve t = new ExecutionThirteen();
  15.         t.talk();
  16.     }
  17. }
Output:
I'm a ExecutionThirteen !

No comments:

Post a Comment

Blueprint for self-improvement

To learn faster: Make the process fun To understand yourself : Write To understand the world better : Read To build deeper connection : Lis...