Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Demystified

Authors: Andrew Oppel

1st Edition

0072253649, 9780072253641

More Books

Students also viewed these Databases questions

Question

2. Do you find change a. invigorating? b. stressful? _______

Answered: 1 week ago