Question: What will the following program print when run? Select the one correct answer. (a) It will just print Test. (b) It will print Test followed
What will the following program print when run?
![public class MyClass { public static void main (String [] args) {](https://dsd5zvtm8ll6.cloudfront.net/images/question_images/1706/9/4/3/74065bde4fc652c21706943736085.jpg)
Select the one correct answer.
(a) It will just print Test.
(b) It will print Test followed by Test.
(c) It will print 123 followed by Test.
(d) It will print 12 followed by Test.
(e) It will print 4 followed by Test.
public class MyClass { public static void main (String [] args) { B b = new B ("Test"); } } class A { A() { this ("1", "2"); } A (Strings, String t) { this (s+t); } A (Strings) { System.out.println (s); } } class B extends A { B (String s) { System.out.println(s); } B (String s, String t) { this (t +s + "3"); } B() { super("4"); }; }
Step by Step Solution
3.38 Rating (154 Votes )
There are 3 Steps involved in it
d The program will print 12 followed by Test When the main method is executed it will create ... View full answer
Get step-by-step solutions from verified subject matter experts
