Answer the question
In order to leave comments, you need to log in
Why do they do it?
Why create an interface if the methods will work anyway?
Why do this:
interface Walking{
public function walk();
}
interface Swimming{
public function swim();
}
class Dog extends Animal implements Walking {
public function walk()
{
// TODO: Implement walk() method.
}
}
class Penguin extends Animal implements Walking, Swimming{
public function walk()
{
// TODO: Implement walk() method.
}
public function swim()
{
// TODO: Implement swim() method.
}
}
class Dog extends Animal{
public function walk()
{
// TODO: Implement walk() method.
}
}
class Penguin extends Animal{
public function walk()
{
// TODO: Implement walk() method.
}
public function swim()
{
// TODO: Implement swim() method.
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question