95-707 - Quizz #1
Name: __________________ Id:______________
Question 1: Java support the older-style top-down procedural programming
approach as a complete solution to a programming problem: True or False?
False. In Java all programs must be written in an object-oriented style
Question 2: Describe how object-oriented programming differs from typical top-down procedural programming?
The classic approach to procedural programming often begins with development of the functions and procedures and then progresses to development of the data structures. The result is frequently a very poor model of the problem being solved. The object-oriented programming approach attempts to express computer programs in ways that model how people perceive the world
Question 3: List two characteristics of an object-oriented language
here are three: encapsulation, inheritance, and polymorphism.
Question 4: An object normally is considered to have _____ and _____.
State and behavior
Question 5: The state of an object is defined by what?
The current values of its instance variables or data members
Question 6: The behavior of an object is defined by what?
The methods of the class from which the object was instantiated
Question 7: An object is an ___________ of a class.
Instance
Question 8: A programmer encapsulates the data representation and behavior of an abstract data type into a class, thereby defining its implementation and interface: True or False?
True
Question 9: In accordance with the theory of reusable code, the programmer should always be concerned with the implementation of the data storage mechanism in a class defined by another programmer: True or False? Explain your answer.
False. If a class is properly defined, adequately tested, and properly documented, it should be possible for another programmer to make use of the class without concern for the actual data storage mechanism employed by the class definition.
Question 10: What does it mean to "send a message to an object" in Java?
Sending a message to an object in Java means to invoke one of its methods