面试题答案
一键面试class Animal:
def __init__(self, name):
self.name = name
def makeSound(self):
print("动物发出声音")
class Dog(Animal):
def makeSound(self):
print("汪汪汪")
def bark(self):
self.makeSound()
class Animal:
def __init__(self, name):
self.name = name
def makeSound(self):
print("动物发出声音")
class Dog(Animal):
def makeSound(self):
print("汪汪汪")
def bark(self):
self.makeSound()