Question: Using the A , B , C , and D classes from this section, what is the output of the following code fragment? public static
Using the A , B , C , and D classes from this section, what is the output of the following code fragment?
![public static void main (String [] args) { A[] elements {new B(), new D(), new A (), new C()}; for (int i = 0; i < elements.length; i++) { elements [i].method2 () ; System.out.println (elements [i]); elements [i].methodl () ; System.out.println ();](https://dsd5zvtm8ll6.cloudfront.net/si.question.images/images/question_images/1606/9/7/8/3965fc88b5ce368b1606978398334.jpg)
public static void main (String [] args) { A[] elements {new B(), new D(), new A (), new C()}; for (int i = 0; i < elements.length; i++) { elements [i].method2 () ; System.out.println (elements [i]); elements [i].methodl () ; System.out.println ();
Step by Step Solution
3.44 Rating (163 Votes )
There are 3 Steps involved in it
Output from AB... View full answer
Get step-by-step solutions from verified subject matter experts
