Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1 Not yet answered What will happen when you compile and run the following code? public class Test{ private int i = 0; Marked

image text in transcribed

Question 1 Not yet answered What will happen when you compile and run the following code? public class Test{ private int i = 0; Marked out of 1.00 P Flag question class TestInner{ public int i = 1; void sayHi() { System.out.println(i); } } public static void main(String[] args) { TestInner inner = new Test().new TestInner(); inner.sayHi(); } } a. 1 O b. Runtime error O c. O O d. Compilation Error Question 2 Not yet answered Marked out of 1.00 What will happen when you compile and run the following code? class One{ public One() { System.out.print("One"); } public One(String str){ System.out.print("OneStr"); } } P Flag question class Two extends One{ public Two (String str){ System.out.print("TwoStr"); super(str); } } public class Test{ public static void main(String[] args) { Two two = new Two ("Hello"); } } O a. OneStr Two Str b. Two StrOne Str Oc. One TwoStrOneStr O d. one of the above

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

fscanf retums a special value EOF that stands for...

Answered: 1 week ago