What will be the output of the following Java program? class…

What will be the output of the following Java program? class Parent { Parent() { System.out.println(“Parent Constructor Called”); } } class Child extends Parent { Child() { System.out.println(“Child Constructor Called”); } } public class Test { public static void main(String[] args) { Child c = new Child(); } }

Which of the following is true about the output? import java…

Which of the following is true about the output? import java.util.concurrent.*; class MyTask implements Runnable { private int taskId; public MyTask(int id) { this.taskId = id; } public void run() { System.out.println(“Task ” + taskId + ” executed by ” + Thread.currentThread().getName()); try { Thread.sleep(100); } catch (InterruptedException e) {} } } public class Main { public static void main(String[] args) { ExecutorService executor = Executors.newFixedThreadPool(2); for (int i = 1; i