Question: Concerning the following two programs, which of the following statement / s is / are correct? class Animal: def getInfo ( self ) : return
Concerning the following two programs, which of the following statements isare correct?
class Animal:
def getInfoself:
return "Animal"
def printself:
self.getInfo
class DogAnimal:
def getInfoself:
return "Dog"
Animal
Dog
class Animal:
def getInfoself:
return "Animal"
def printself:
printselfgetInfo
class DogAnimal:
def getInfoself:
Animalprint
Dog
A The output of the first program is:
Animal
Dog
E The output of the second program is:
Animal
Dog
C In the first program, the getInfo method will be overridden in class Dog
D In the second program, the getlnfo method will not be overridden in class Dog
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
