Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

solve 8 &9 8. What would be the output of the following code: class Test1{ private String str = Test1; class TestRemol public void showmel){

image text in transcribed

image text in transcribed

solve 8 &9

8. What would be the output of the following code: class Test1{ private String str = "Test1"; class TestRemol public void showmel){ public static void main(String args[]}{ System.out.printlo(str); Test1 t1 = new Test1(); } Test2 t2 = new Test2(); } Test3 t3 = new Test3(); class Test2 extends Test1{ private String str = "Test2"; public void showmel System.out.println(str); } } t1 = t2; t1.showmel); t1 = t3; t1.showmel); t2 = t3; t2.showmel); } class Test3 extends Test2 { private String str = "Test3"; public void showmel System.out.println(str); } } 9. What would be the output of the following program: = class Super Show { String str = "SuperClass"; public void show() { System.out.println("Super Show: } } class Extended Show extends Super Show{ String str = "SubClass"; public void show(){ System.out.println("Sub, Show: } } 08 + str); + str); public class ExtensionDeme { public static void main(String args[]){ Extended Show ext = new ExtendedShow(); Super Show sup = ext; sup.show(); ext.show(); System.out.println("supostr: System.out.println("subastr: ET + supstr); + ext.str); ET }

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

Step: 3

blur-text-image

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

Advances In Databases And Information Systems 23rd European Conference Adbis 2019 Bled Slovenia September 8 11 2019 Proceedings Lncs 11695

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Aida Kamisalic Latific

1st Edition

3030287297, 978-3030287290

More Books

Students also viewed these Databases questions

Question

1. Select the job or jobs to be analyzed.

Answered: 1 week ago