Look at the following pseudocode class definitions:
Class Vegetable
Public Module message ()
Display “I’m a vegetable.”
End Module
End Class
Class Potato Extends Vegetable
Public Module message ()
Display “I’m a potato.”
End Module
End Class
Given these class definitions, what will the following pseudocode display?
Declare Vegetable v
Declare Potato p
Set v = New Potato ()
Set p = New Potato()
Call v. message()
Call p. message()
Want to see the full answer?
Check out a sample textbook solutionChapter 14 Solutions
Starting Out with Programming Logic and Design (4th Edition)
Additional Engineering Textbook Solutions
Java: An Introduction to Problem Solving and Programming (7th Edition)
Starting Out with C++ from Control Structures to Objects (8th Edition)
C Programming Language
Starting Out With Visual Basic (8th Edition)
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)