OOPEXAM Flashcards
Sequence of instructions expressed in specific programming language.
System
Model
Computer
Program
Program
Computers native language.
Assembly language
Machine language
System
Programming Language
Machine language
He received ACM’s Turing Award, the “Nobel Prize of Computing,” in 2003 for Smalltalk, the first complete dynamic OOPL
Dr. Alan Key
Dr. Allan K
Dr. Alan Kay
Blaise Pascal
Dr. Alan Kay
Simplified representation of salient features of something, either tangible or abstract
Model
Program
System
Syntax
Model
Grammatical rules for forming instructions.
Semantics
Syntax
Model
System
Syntax
Collection of collaborating components
Syntax
System
Model
Semantics
System
Two-step process to translate from Java to machine language:
Execution
Semantics
Syntax
Compilation
Execution
Compilation
In OOP, objects are considered anthropomorphic. anthropomorphic meaning ____
Reliable
Fast
Smart
Easy
Smart
Gathering and analyzing the needs and requirements of the stakeholders.
Requirement Analysis
Creating the architecture and design for the software based on the requirements.
Design
Writing the actual code and developing the software according to the design specifications.
Implementation
Java was developed by Sun Microsystems and it is meant to run on many “platforms” without change, from desktop to cell phones
T/F
T
Identify the validity of the given statements.
I. A default constructor is provided when constructors are defined in a class.
II. To encapsulate an object, fields must be publicly available.
Both statements are True
Neither statment is True
Only statement II is True
Only statment I is True
Neither statment is True
These are methods that retrieves field values.
private
public
accessor
setters
accessor
Identify the validity of the given statements.
I. Runner program is not an object.
II. Method parameters must have different names from the class fields.
Only statement I is True
Both statements are True
Neither statement is True
Only statement II is True
Neither statement is True
Identify the validity of the given statements.
I. All instances has the same attribute values.
II. All instances has the same methods.
Neither statement is True
Both statements are True
Only statement I is True
Only statement II is True
Only statement II is True
Identify the validity of the given statements.
I. Constructors can be overloaded.
II. Support methods are public.
Neither statement is True
Only statement II is True
Only statement I is True
Both statments are True
Only statement I is True
It is the blueprint of an object.
Class
Behavior
Attributes
Method
Class
It is the abstraction of a real world concept into programming.
Class
Object
Interface
Inheritance
Object
It is the representation of object characteristics on Java programming.
Attributes
Instance Fields
Behavior
Methods
Attributes
What is the value of an object types in the default constructor?
null
0
false
empty character
null
Identify the validity of the given statements.
I. Constructors has the same name as the class.
II. Void return type does not provide any value.
Only statement II is True
Neither statement is True
Both statements are True
Only statement I is True
Both statements are True
It is the concept of hiding details you do not care about as a user.
Abstraction
Antrophomorphic
Objects
Black Box
Abstraction
These are the capabilities of an object
Objects
Behavior
Attributes
Constructor
Behavior
Where does overloaded methods differ?
modifier
name
return type
parameter list
parameter list
This property states that objects are smart on their own but requires others to tell what it needs to do.
Polymorphic
Black Box
Intelligent
Anthropomorphic
Anthropomorphic
It is the keyword that pointsto the current instance.
class
Class
self
this
this
Identify the validity of the 2 statements.
I. The last step when instantiating a subclass is calling its superclass instructor.
II.Method resolution stops when the method cannot be found in the super class.
Only statement II is True
Correct!
Neither statement is True
Both statements are True
Only statement I is True
Neither statement is True
Identify the validity of the 2 statements.
I. A subclass can access methods from its superclass.
II.When an instance is polymorphed, it can only call methods from the parent type.
Only statement I is True
Neither statement is True
Both statements are True
Only statement II is True
Both statements are True
Identify the validity of the 2 statements.
I. The extends keyword is used to inherit classes.
II.When A extends B, A is the subclass and B is the super class.
Only statement II is True
Only statement I is True
Both statements are True
Neither statement is True
Both statements are True
Identify the validity of the 2 statements.
I. Objects can command themselves.
II.Override annotation is optional when overriding a method.
Only statement II is True
Both statements are True
Neither statement is True
Only statement I is True
Only statement II is True
Identify the validity of the 2 statements.
I. Object instances has the same set of attributes.
II.The default constructor is available even when other constructors are defined.
Only statement I is True
Only statement II is True
Both statements are True
Neither statement is True
Both statements are Tru
Identify the validity of the 2 statements.
I. Interfaces enforces differences in different objects.
II.Abstraction is applied in object design while Encapsulation is applied in object implementation.
Both statements are True
Neither statement is True
Only statement II is True
Only statement I is True
Only statement II is True
Identify the validity of the 2 statements.
I. A single class can be used to create multiple instances.
II.A class is required to define all methods from the interface..
Neither statement is True
Only statement I is True
Both statements are True
Only statement II is True
Both statements are True
Identify the validity of the 2 statements.
I. Derived classes has access to public fields and methods available from the base class.
II.Association represents “Is-a” relationship.
Both statements are True
Neither statement is True
Only statement II is True
Only statement I is True
Only statement I is True
Identify the validity of the 2 statements.
I. Accessors modify the object field value.
II.Object contains permanent attribute values.
Only statement II is True
Neither statement is True
Only statement I is True
Both statements are True
Neither statement is True
Identify the validity of the 2 statements.
I. Method parameter names must be different from field names.
II.To encapsulate a class, methods must be private.
Only statement I is True
Both statements are True
Only statement II is True
Neither statement is True
Neither statement is True
Identify the validity of the 2 statements.
I. Constructors can only be defined once.
II.Objects only represent real concepts.
Only statement II is True
Both statements are True
Neither statement is True
Only statement I is True
Neither statement is True
Identify the validity of the 2 statements.
I. Interfaces do not contain method procedures.
II.Protected modifier makes the field available to its subclasses.
Only statement I is True
Both statements are True
Neither statement is True
Only statement II is True
Both statements are True
Identify the validity of the 2 statements.
I. Class represents a blueprint for an object.
II.Constructors need a return type in the definition.
Both statements are True
Only statement II is True
Neither statement is True
Only statement I is True
Only statement I is True
Identify the validity of the 2 statements.
I. The create keyword is used when instantiating an object.
II.In composition, each related object can exist on its own.
Only statement I is True
Neither statement is True
Only statement II is True
Both statements are True
Neither statement is True
Identify the validity of the 2 statements.
I. Attributes are represented by methods.
II.The super keyword is used to access the parent class directly.
Neither statement is True
Both statements are True
Only statement I is True
Only statement II is True
Only statement II is True
Identify the validity of the 2 statements.
I. A class can inherit multiple interfaces.
II. Generally, a program in Java is composed of a single object.
Neither statement is True
Both statements are True
Only statement II is True
Only statement I is True
Only statement I is True
Identify the validity of the 2 statements.
I. Support methods are public methods.
II.In inheritance, an asymmetrical relationship is formed.
Both statements are True
Neither statement is True
Only statement II is True
Only statement I is True
Only statement II is True
Identify the validity of the 2 statements.
I. All methods return a value upon being called.
II. False is the default value of a boolean field in the default constructor.
Neither statement is True
Only statement II is True
Both statements are True
Only statement I is True
Only statement II is True
Identify the validity of the 2 statements.
I. Methods represents the behavior of an object.
II.Model is the realization of an object.
Both statements are True
Only statement I is True
Neither statement is True
Only statement II is True
Only statement I is Tru
Identify the validity of the 2 statements.
I. When A implements B, A can be stored as type B.
II.Methods represents the behavior of an object.
Only statement II is True
Only statement I is True
Neither statement is True
Both statements are True
Both statements are True
TRUE: FALSE
The given code below copies the data from a source to the destination. This cannot be done with an upper bound limit since we want them both to be generic.
public<T, S super T> S[] copy(T[] src, S[] dest){
for(int i=0; i<src.length; i++){
dest[i] = src[i];
}
return dest;
}
False
True
T
Which is not an advantage of applying MVC?
Serial Development
Test Driven
Clear Separation of Concerns
Easy Code Maintenance
Serial Development
a process in which the current state of the Object will be saved in the stream of bytes.
MVC
Controller
Generic
Serialization
Serialization
These are nameless classes defined inside another class.
Method Local Inner Class
Anonymous Inner Class
Outer Class
Inner Class
Anonymous Inner Class
It is the component which can provide a graphical representation of the data.
Model
View
Controller
Framework
View
It is the architecture or pattern that divides an application to 3 major components: view, controller and model.
MVC Architecture
VCM Architecture
CVM Architecture
MCV Architecture
MVC Architecture
What does the code below mean?
public<T, S super T> S[] copy(T[] src, S[] dest){
for(int i=0; i<src.length; i++){
dest[i] = src[i];
}
return dest;
}
both a and b
none of the choices
the possible types that can be accepted by method will be limited to all subclasses of the Number class.
the destination collection will only accept the superclass types of T.
the destination collection will only accept the superclass types of T.
If the model is defined as Observable and the view is defined as Observer, we still need to indicate to which model the view should listen to. This is done by calling _________________method on the model.
…
public class Controller extends JFrame{
private Ball model;
private View view;
private JButton btnStep;
public Controller(){
model = new Ball(1, 1, 1, 1, 10);
view = new View(model);
btnStep = new JButton(“Step”);
add(view); add(btnStep, BorderLayout.SOUTH); model.addObserver(view); btnStep.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae){ model.move(view.getWidth(), view.getHeight()); } }); } }
add(btnStep, BorderLayout.SOUTH)
add controller
add (view)
addObserver
addObserver
Which of the following statements are true?
I. Observable is an interface and Observer is a class.
II. Observer is an interface and Observable is a class.
Only statement II is True
Both statements are True
Only statement I is True
Neither statement is True
Only statement II is True
Classes are defined at the method level.
Method Local Inner Class
MVC
Anonymous Inner Class
Inner Class
Method Local Inner Class