Question: Question 36 A class constructor cannot be private. Not yet answered Select one: Marked out of 1.00 True False P Flag question Question 37 Not

Question 36 A class constructor cannot be private. Not yet answered Select one: Marked out of 1.00 True False P Flag question Question 37 Not yet answered Marked out of 1.00 What will happen when you compile and run the following code? class One int i = 1; public One() { System.out.println(i); } } P Flag question class Two extends One{ int i = 10; public One() { System.out.println(i); } } public class Test{ public static void main(String[] args) { One one = new Two(); } } O a. Compilation error O b. Runtime error O c. 10 O d. 1 Question 38 What will happen when you compile and run the following code? public class Test{ Not yet answered Marked out of 1.00 P Flag question class TestInner{ void sayHi() { System.out.println("Hi"); } } public static void main(String[] args) { TestInner inner = new TestInner(); inner.sayHi(); } } a. No Output O b. Runtime Error O c. Compilation Error d. Hi
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
