OOPEXAM Flashcards

1
Q

Sequence of instructions expressed in specific programming language.
System
Model
Computer
Program

A

Program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Computers native language.
Assembly language
Machine language
System
Programming Language

A

Machine language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

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

A

Dr. Alan Kay

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Simplified representation of salient features of something, either tangible or abstract
Model
Program
System
Syntax

A

Model

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Grammatical rules for forming instructions.
Semantics
Syntax
Model
System

A

Syntax

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Collection of collaborating components
Syntax
System
Model
Semantics

A

System

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Two-step process to translate from Java to machine language:
Execution
Semantics
Syntax
Compilation

A

Execution
Compilation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

In OOP, objects are considered anthropomorphic. anthropomorphic meaning ____
Reliable
Fast
Smart
Easy

A

Smart

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Gathering and analyzing the needs and requirements of the stakeholders.

A

Requirement Analysis

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Creating the architecture and design for the software based on the requirements.

A

Design

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Writing the actual code and developing the software according to the design specifications.

A

Implementation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Java was developed by Sun Microsystems and it is meant to run on many “platforms” without change, from desktop to cell phones

T/F

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

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

A

Neither statment is True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

These are methods that retrieves field values.
private
public
accessor
setters

A

accessor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

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

A

Neither statement is True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

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

A

Only statement II is True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

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

A

Only statement I is True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

It is the blueprint of an object.
Class
Behavior
Attributes
Method

A

Class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

It is the abstraction of a real world concept into programming.
Class
Object
Interface
Inheritance

A

Object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

It is the representation of object characteristics on Java programming.
Attributes
Instance Fields
Behavior
Methods

A

Attributes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is the value of an object types in the default constructor?
null
0
false
empty character

A

null

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

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

A

Both statements are True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

It is the concept of hiding details you do not care about as a user.
Abstraction
Antrophomorphic
Objects
Black Box

A

Abstraction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

These are the capabilities of an object
Objects
Behavior
Attributes
Constructor

A

Behavior

25
Q

Where does overloaded methods differ?
modifier
name
return type
parameter list

A

parameter list

26
Q

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

A

Anthropomorphic

27
Q

It is the keyword that pointsto the current instance.
class
Class
self
this

A

this

28
Q

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

A

Neither statement is True

29
Q

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

A

Both statements are True

30
Q

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

A

Both statements are True

31
Q

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

A

Only statement II is True

32
Q

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

A

Both statements are Tru

33
Q

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

A

Only statement II is True

34
Q

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

A

Both statements are True

35
Q

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

A

Only statement I is True

36
Q

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

A

Neither statement is True

37
Q

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

A

Neither statement is True

38
Q

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

A

Neither statement is True

39
Q

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

A

Both statements are True

40
Q

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

A

Only statement I is True

41
Q

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

A

Neither statement is True

42
Q

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

A

Only statement II is True

43
Q

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

A

Only statement I is True

44
Q

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

A

Only statement II is True

45
Q

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

A

Only statement II is True

46
Q

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

A

Only statement I is Tru

47
Q

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

A

Both statements are True

48
Q

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

A

T

49
Q

Which is not an advantage of applying MVC?
Serial Development
Test Driven
Clear Separation of Concerns
Easy Code Maintenance

A

Serial Development

50
Q

a process in which the current state of the Object will be saved in the stream of bytes.
MVC
Controller
Generic
Serialization

A

Serialization

51
Q

These are nameless classes defined inside another class.
Method Local Inner Class
Anonymous Inner Class
Outer Class
Inner Class

A

Anonymous Inner Class

52
Q

It is the component which can provide a graphical representation of the data.
Model
View
Controller
Framework

A

View

53
Q

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

A

MVC Architecture

54
Q

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.

A

the destination collection will only accept the superclass types of T.

55
Q

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

A

addObserver

56
Q

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

A

Only statement II is True

57
Q

Classes are defined at the method level.

Method Local Inner Class
MVC
Anonymous Inner Class
Inner Class

A

Method Local Inner Class

58
Q
A