Вы находитесь на странице: 1из 12

MULTIPLE CHOICE

1. What type of programming is centered on the procedures or actions that take place in a
program?
a. Object-oriented
b. Interactive
c. Procedural
d. Menu-driven
e. None of the above
ANS: C
2. What type of programming encapsulates data and functions together in an object?
a. Object-oriented
b. Interactive
c. Procedural
d. Menu-driven
e. None of the above
ANS: A
3. What software entity contains both data and procedures?
a. Objects
b. Instances
c. Events
d. Memory location(s)
e. None of the above

ANS: A
4. The variables, arrays, or other data structures that are stored in the object are known as the
objects __________.
a. Records
b. Methods
c. Addresses
d. Fields
e. None of the above
ANS: D
5. The procedures that the object performs are known as ____________.
a. Records
b. Methods
c. Addresses
d. fields
e. None of the above
ANS: B
6. The programmer determines the fields and methods of an object and creates the ______ code.
a. Print
b. Class
c. Module
d. Procedure
e. None of the above

ANS: B
7. The class _________ starts with the word Class followed by the name of the class.
a. body
b. definition
c. return
d. members
e. None of the above
ANS: B

8. What is the term used for the fields and methods that belong to a class?
a. body
b. definition
c. return
d. members
e. None of the above
ANS: D

9. The word Private that appears before a field declaration, in a class definition, is known as a(n)
____________.
a. access specifier
b. specifier
c. Class specifier
d. Inside specifier
e. None of the above

ANS: A

11. What allows you to create methods with the same name in different classes and gives you the
ability to call the correct method depending on the type of object that is used to call it?
a. Constructor
b. Inheritance
c. Accessor
d. Polymorphism
e. None of the above
ANS: D

12. ________________________ is a standard way of drawing diagrams that describe objectoriented systems.
a. Data flow diagram
b. UML
c. flowchart
d. Hierarchy chart
e. None of the above
ANS: B

13. _______________ is another name for accessor methods.


a. getters
b. accessors
c. setters
d. private
e. None of the above

ANS: A

14. Which method is called automatically when an object is created?


a. design
b. public
c. private
d. constructor
e. None of the above
ANS: D

15. ____________________ allows a new class to extend an existing class.


a. successor
b. accessor
c. inheritance
d. public
e. None of the above

ANS: C

16. Which of the following tasks are performed by a procedure?


a. Reading a file
b. Gathering input
c. Displaying output
d. All of the above
e. None of the above

ANS: D

17. Which of the following are contained in a UML diagram for a class?
a. Class name
b. Class fields
c. Class methods
d. All of the above
e. None of the above
ANS: D

18. Which one of the following, in the list below, represents a Class/Object?
a. Program/dataMembers
b. Car/engine
c. Ford/cheveolet
d. Girl/beverly
e. None of the above
ANS: D
19. In a class definition, operations such as if-else, loops, and calculations are specified in:
a. properties
b. records
c. attributes
d methods
e.None of the above
ANS: D
20. A data member that is private

a. cannot be referred to by methods that are public


b. cannot be referred to from anywhere outside the class in which it is declared
c is usable only by a constructor method.
d.must be declared before data members that are public are declared.
e. None of the above
ANS: B
21. accountNum =account.getAccountNumber(inAccountNum)
a. Argument = method.objectNmae(variable)
b. variable = objectName.method(argument)
c. objectName = method.variable(argument)
d. variable = objectName.argument(method)
e. None of the above
ANS: B

TRUE/FALSE
1. True/False: Procedures, typically, operate on data items that are within the procedure.
ANS: F
2. True/False: The act of declaring a class variable does not actually create an object in memory.
ANS: T
3. True/False: If a constructor is not written when the class is compiled, then a constructor is
automatically provided and it is known as the default constructor.
ANS: T
4. True/False: When a superclass method has the same name as a subclass method, it is often
said that the superclass method overrides the subclass method.

ANS: F

5. True/False: External entities do not have direct access to the objects private methods.

ANS: T

6. True/False: When the program is running, it can use the class to create, in memory, one object
of a specific type as needed.

ANS: F

7. True/False: The private object fields can be directly manipulated by outside entities.

ANS: F

8. True/False: When a class variable is assigned the address of an object, it is said that the
variable references the object.

ANS: T

9. True/False: In an inheritance relationship, the superclass inherits members from the subclass,
not the other way around.

ANS: F

10. True/False: When an objects internal data is hidden from outside code and access to the data
is restricted to the objects methods, the data is protected from accidental corruption.

ANS: T

11. True/False: There are primarily three methods of programming in use today: procedural,
recursive, and object-oriented.

ANS: F

12. True/False: The separation of data and the code that operates on the data can lead to problems
as a program becomes larger and more complex.

ANS: T

FILL IN THE BLANK


1. A ________ is simply a module or function that performs a specific task.
ANS: procedure

2. The objects ___________ are the modules and functions of the object.
ANS: methods

3. ___________ are created from abstract data types that encapsulate data and functions
together.
ANS: Objects

4. ______________ refers to the combining of data and code into a single object.
ANS: Encapsulation

5. ____________ programming is a method of writing software where it is centered on the


procedures or actions that take place in a program.
ANS: Procedural

6. A ________ is the blueprint of the object that is created from it.


ANS: class

7. The data contained in an object are known as the objects __________.

ANS: fields

8. The key word ___________ creates the object in memory.


ANS: New

9. The methods that can be accessed by entities outside the object are known as _________
methods.
ANS: public

10. ____________ refers to an objects ability to hide its data from code that is outside the object.

ANS: Data hiding

11.

A method that gets a value from a classs field but does not change it is known as a(n)
____________ method.

ANS: access

12. The methods in an object that are used to initialize an objects fields with starting values are
called ________________.

ANS: constructors

13. A __________ is code that specifies the fields and methods for a particular type of object.
ANS: class

14. Each object that is created from a class is called a(n) _________ of the class.
ANS: instance

15. __________ programming is centered on creating modules and functions.


ANS: Procedural

16. An ________ is not a stand-alone program, but is used by programs that need its service.
ANS: object

17. A ________ is a method that automatically called when an object is created.


ANS: constructor

Вам также может понравиться