Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

8. What will be the output of the following program? public class A { public void printName() { System.out.println(Name-A); } } public class B extends

image text in transcribed
image text in transcribed
image text in transcribed
8. What will be the output of the following program? public class A { public void printName() { System.out.println("Name-A"); } } public class B extends A{ public void printName() { System.out.println("Name-B"); 1 1 public class test { public static void main(String[] args) { Bb=new BO; newPrint (b); 1 public static void newPrint (A a) a.printName(); ) 1 a) Compilation fails b) Name-B Name: d) Name-B Name A Name.A Name- 9. A method in a subclass that has the same signature as a method in the superclass is an example of a) composition b) overriding an error d) overloading Bo brak C) Kapat Sanayi Butir CODE o F1 F5 F2 F6 F7 F10 F8 F9 F3 fe 12- Which of the following is correct syntax for defining a new class Dog based on the superclass Mammal? a) class Mammal extends Dog {//additional definitions go here) b) class Dog defines Mammal {//additional definitions go here } C class Dog isa Mammal {//additional definitions go here } ay class Dog extends Mammal {//additional definitions go here } e) class Dog implements Mammal { //additional definitions go here } Bos brak ce

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

Database And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 1 Lncs 13426

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124227, 978-3031124228

More Books

Students also viewed these Databases questions

Question

What is Constitution, Political System and Public Policy? In India

Answered: 1 week ago

Question

What is Environment and Ecology? Explain with examples

Answered: 1 week ago