Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started