This forum is now read-only. Please use our new forums! Go to forums
Correct output, odd error
I keep getting the error “Oops, try again. Did you create a class called Bicycle?”, although I have the correct output. Is this a bug, or is there something I’m missing in my code below?
<?php
class Vehicle {
public function honk() {
return "HONK HONK!";
}
}
// Add your code below!
class Bicycle extends Vehicle {
public function honk() {
return "Beep beep!";
}
}
$bicycle = new Bicycle();
echo $bicycle->honk();
?>
Answer 5331d4837c82cadbd6000e4f
3 votes
Never mind; it seems to have gone through the 10th time I hit submit.
Answer 53c549ac9c4e9d827b004a8f
0 votes
I capitalized “Class” Bicycle and it went through
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency
3 comments
thnx!!
it works
I can’t get mine’s working! I did it 20 times!