Multiple choice technology programming languages

What will be printed when you execute the following code? class X { Y b = new Y(); X() { System.out.print("X"); } } class Y { Y() { System.out.print("Y"); } } public class Z extends X { Y y = new Y(); Z() { System.out.print("Z"); } public static void main(String[] args) { new Z(); } }

  1. z

  2. yz

  3. xyz

  4. yxyz

Reveal answer Fill a bubble to check yourself
C Correct answer