Exam 3
"Art" is an example of a(n) ________. A) abstract object B) concrete object C) real object D) virtual object
A
A "student becomes a graduate" describes the ________ of object "student." A) state B) attribute C) name D) identity
A
A superclass results from ________ a set of classes. A) generalizing B) class hierarchy of C) specializing D) all of the above
A
An instance is the concrete manifestation of a ________. A) class B) object C) state D) attribute
A
Attributes are usually paired with ________. A) values B) features C) identity D) name
A
Consider the two phrases describing a telephone: has a microphone and can connect to the telephone network. These two phrases are ________ and ________, respectively. A) attribute, operation B) operation, attribute C) state, attribute D) state, operation
A
Human body is an example of a(n) ________ relationship. A) composition B) generalization C) aggregation D) public class
A
Information systems are composed of ________. A) virtual objects B) real objects C) any object D) computer objects
A
Object-oriented analysis and design, coupled with ________, is used as the most effective technique to build software and information systems. A) object-oriented technology B) implementation C) requirement D) maintenance
A
Object-oriented programming allows you to derive new classes from existing classes. This is called ________. A) inheritance B) abstraction C) encapsulation D) generalization
A
Objects interact through ________ when offering services or operation to the public. A) interfaces B) business classes C) public services D) public operations
A
The identity of an object is identified by its ________. A) name B) presence C) value D) none of the above
A
When invoking a method with an object argument, ________ is passed. A) the reference of the object B) a copy of the object C) the contents of the object D) the object is copied, then the reference of the copied object
A
Which of the following is NOT a type of class for virtual objects? A) computer class B) business class C) utility classes D) control class
A
Which of the following statement is false? (Choose all that apply.) A) At least one constructor must always be defined explicitly. B) Constructors must have the same name as the class itself. C) A default no-arg constructor is provided automatically if no constructors are explicitly declared in the class. D) Constructors are invoked using the new operator when an object is created. E) Constructors do not have a return type, not even void.
A
________ is invoked to create an object. A) A constructor B) A method with the void return type C) A method with a return type D) The main method
A
________ represents an entity in the real world that can be distinctly identified. A) An object B) A method C) A class D) A data field
A
Attributes of an object constitute what an object ________, while operations describe what it ________. A) does, is B) is, does C) has, predicts D) suggests, presents
B
Given the declaration Circle[ ] x = new Circle[10], which of the following statement is most accurate? A) x contains a reference to an array and each element in the array can hold a Circle object. B) x contains a reference to an array and each element in the array can hold a reference to a Circle object. C) x contains an array of ten int values. D) x contains an array of ten objects of the Circle type.
B
The keyword ________ is required to declare a class. A) private B) class C) public D) All of the above
B
The relationship among superclasses and subclasses is called ________. A) generalization B) class hierarchy C) specializing D) none of the above
B
Together, encapsulation and information hiding turn an object into a black box dividing the space in which the object lives into ________ and ________. A) indoor, outdoor B) private, public C) upside, downside D) general, specific
B
What is the output of the following code: public class Test { public static void main(String[ ] args) { Object o1 = new Object(); Object o2 = new Object(); System.out.print((o1 == o2) + " " + (o1.equals(o2))); } } A) true false B) false false C) false true D) true true
B
Which of the following are Java keywords? A) cast B) instanceof C) instanceOf D) casting
B
Which of the following statement is true? A) A method can be overridden in the same class. B) If a method overrides another method, these two methods must have the same signature. C) A method cannnot be overloaded in the same class. D) If a method overloads another method, these two methods must have the same signature
B
"The employee name is Richard Smith and he checks the inventory periodically." In this sentence, "Richard Smith" is the ________ of attribute "name" A) class B) object C) value D) operation
C
A subclass results from ________ a superclass. A) generalization B) class hierarchy of C) specializing D) all of the above
C
A system development team is an example of a(n) ________ relationship A) composition B) generalization C) aggregation D) public class
C
An object can be an instance of numerous classes that have ________ relationships to each other. A) parallel B) hierarchical C) both A & B D) none of the above
C
An object is the subject of a sentence with an active voice, and the ________ expresses an operation. A) action B) subject C) verb D) voice
C
Features, properties, or characteristics of an object are represented by its ________. A) values B) identity C) attributes D) name
C
Given the declaration Circle x = new Circle(), which of the following statement is most accurate? A) x contains an object of the Circle type. B) x contains an int value. C) x contains a reference to a Circle object. D) You can assign an int value to x.
C
In object-oriented technique, the opposite of generalization is ________. A) degeneralization B) abstraction C) specialization D) none of the above
C
When using an object-oriented approach to software development we create models using ________, their relationships, and their interactions. A) programs B) system analysts C) objects D) project mangers
C
Which is the advantage of encapsulation? A) It changes a class's contract without changing the implementation and causes no consequential changes to other code. B) Making the class final causes no consequential changes to other code. C) It changes the implementation without changing a class's contract and causes no consequential changes to other code. D) Only public methods are needed.
C
Which of the statements regarding the super keyword is incorrect? A) You can use super to invoke a super class constructor. B) You cannot invoke a method in superclass's parent class. C) You can use super.super.p to invoke a method in superclass's parent class. D) You can use super to invoke a super class method.
C
________ literally means "many shapes." A) Polymath B) Polynomial C) Polymorphism D) Polypheric
C
A class is a(n)________ for a virtual object. A) abstraction B) template C) collection D) both A & B
D
An infant boy grows to be a 80-year-old man. The new state of the object is ________. A) a grandfather B) an old and rich man C) an old and wise man D) all or any of the above
D
An object is ________. A) something that is perceived as an entity and referred to by name B) something perceptible by one or more of the senses C) something intelligible or perceptible by the mind D) all of the above
D
An object is a thing and can be ________. A) animate or inanimate B) human or non-human C) tangible or non-tangible D) any of the above
D
An object is an instance of a ________. A) method B) data C) program D) class
D
Class is a set of objects that share the same ________. A) name B) state C) attributes and operations D) all of the above
D
Encapsulation means ________. A) that a variable of supertype can refer to a subtype object B) that a class can contain another class C) that a class can extend another class D) that data fields should be declared private
D
In procedural languages, the basic building blocks of a program are ________. A) procedures B) objects C) functions D) A or C
D
Inheritance means ________. A) that a class can contain another class B) that data fields should be declared private C) that a variable of supertype can refer to a subtype object D) that a class can extend another class
D
Polymorphism means ________. A) that data fields should be declared private B) that a class can contain another class C) that a class can extend another class D) that a variable of supertype can refer to a subtype object
D
The phrase "object as black box" refers to ________. A) encapsulation B) information hiding C) generalization D) both A & B
D
To declare a constant MAX_LENGTH as a member of the class, you write ______________ A) final double MAX_LENGTH = 99.98; B) final static float MAX_LENGTH = 99.98; C) final static MAX_LENGTH = 99.98; D) final static double MAX_LENGTH = 99.98; E) static double MAX_LENGTH = 99.98;
D
What is the output of the following code: public class Test { public static void main(String[ ] args) { String s1 = new String("Java"); String s2 = new String("Java"); System.out.print((s1 == s2) + " " + (s1.equals(s2))); } } A) false false B) true true C) true false D) false true
D
When you use a bank ATM, encapsulation ensures that ________. A) you are not burdened with the complexity of how the machine works B) only operations that you are allowed are performed C) the way the machine operates is not changed D) all of the above
D
Which of the following statement is true? A) A subclass is a subset of a superclass. B) "class A extends B" means B is a subclass of A. C) "class A extends B" means A is a superclass of B. D) A subclass is usually extended to contain more functions and more detailed information than its superclass.
D
________ is a construct that defines objects of the same type. A) A method B) A data field C) An object D) A class
D
________ is the condition of an object at a certain stage in its lifetime. A) Attribute B) Identity C) Operation D) State
D
A Java exception is an instance of ________. A) RuntimeException B) Exception C) Error D) NumberFormatException E) Throwable
E