Question
Consider the following class and print the output: abstract class Test1 { static int x; Test1() { System.out.printf(Making objects); } public abstract void restful(int x);
Consider the following class and print the output:
abstract class Test1 { static int x; Test1() { System.out.printf(Making objects); } public abstract void restful(int x); }
public class Test2 extends Test1 { public void restful(int x) { System.out.printf(class Test2); } }
public class Test3 extends Test1 { Test3() { super(); } public void restful(int x) { System.out.printf(class Test3); } }
public class Driver { public static void main(String [] args) { Test2 a1 = new Test1(); Test3 a2 = new Test(); a1.restful(15); a2.restful(20); Test a3 [] = new Test[5]; for(int i=0;i for(int i=0;i
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started