Sunteți pe pagina 1din 4

QUESTION 1

1. An instance of a user-defined type is called a(n)


class
interface
object
None of the above
1.56 points

QUESTION 2
1. A class’s initializes members of that class
constructor
utility method
access modifier
None of the above
1.56 points

QUESTION 3
1. Which of the following statements is true?
Methods and instance variables can both be either public or private
Information hiding is achieved by restricting access to class members via
keyword public
The public members of a class are not directly accessible to the client of a class.
None of the above is true
1.56 points

QUESTION 4
1. In a method in which a parameter has the same name as an instance variable, using
the this reference allows you to refer to ________.
the parameter
the instance variable
varies depending on the situation
None of the above
1.56 points
QUESTION 5
1. Having a this reference allows:
A method to refer explicitly to the instance variables and other methods of the
object on which the method was called
A method to refer implicitly to the instance variables and other methods of the
object on which the method was called
An object to reference itself
All of the above
1.56 points

QUESTION 6
1. Which of the following is a valid indexer header?
this [ IndexType1 name 1, …] accessModifer returnType
this [ IndexType1 name 1, …] returnType accessModifer
accessModifer returnType this [ IndexType1 name 1, …]
returnType accessModifer this [ IndexType1 name 1, …]
1.56 points

QUESTION 7
1. A constructor cannot:
be overloaded
initialize variables to their defaults
specify return types or return values
have the same name as the class
1.56 points

QUESTION 8
1. Constructors:
initialize instance variables
when overloaded, can have identical argument lists
when overloaded, are selected by number and types of parameters
a and c
1.56 points

QUESTION 9
1. The use of references to objects of preexisting classes as members of new objects is
called
inheritance
composition
polymorphism
None of the above
1.56 points

QUESTION 10
1. Composition:
Is a form of software reuse
Is using an object reference as a class member
Is a good design practice
All of the above
1.56 points
QUESTION 11
1. A can be defined in a class to perform termination housekeeping on an object
before the garbage collector reclaims the object’s memory
destructor
property
garbage collector
None of the above
1.56 points

QUESTION 12
1. Which of the following describes a static variable?

a variable with one copy shared by all class objects


a variable whose value may not be changed
all of the above
None of the above
1.56 points

QUESTION 13
1. Keyword is used for constants whose values cannot be determined at compile
time
const
readonly
static
None of the above
1.56 points
QUESTION 14
1. Abstract Data Types:
elevate the importance of data
are only approximations or models of real-world concepts and behaviors
capture two notions, data representation and operations
All of the above
1.56 points

QUESTION 15
1. A class is made into a for use in other programs
dynamic link library
data location library
data loading library
None of the above
1.56 points
QUESTION 16
1. A common result of reusing software is
virus infection
naming collisions
insecure programs
None of the above

S-ar putea să vă placă și