Object Oriented Programming

What is an example of dynamic binding?

1.

any method

2.

method overloading

3.

method overriding

4.

compiling

Q 1 / 85

Object Oriented Programming

For which case would the use of a static attribute be appropriate?

1.

the number of people in each house in a small neighborhood

2.

the lot size for each house in a small neighborhood

3.

the color of each house in a small neighborhood

4.

the weather conditions for each house in a small neighborhood

Q 2 / 85

Object Oriented Programming

undefined

1.

to avoid redundant coding in children

2.

to explore a hypothetical class

3.

to prevent unwanted method implementation

4.

to reserve memory for an unspecified class type

Q 3 / 85

Object Oriented Programming

undefined

1.

to have common behavior in derived classes

2.

to explore a hypothetical class

3.

to prevent unwanted method implementation

4.

to reserve memory for an unspecified class type

Q 4 / 85

Object Oriented Programming

undefined

1.

only when you export

2.

both at compile time and runtime

3.

at compile time

4.

at runtime

Q 5 / 85

Object Oriented Programming

undefined

1.

It will result in code that is more extensible and maintainable

2.

It will result in a more compact product.

3.

It will speed initial development.

4.

It will allow you to add that design pattern to your resume.

Q 6 / 85

Object Oriented Programming

undefined

1.

defining classes by focusing on what is important for a purpose

2.

hiding the data and implementation details within a class

3.

making all methods private

4.

using words to define classes

Q 7 / 85

Object Oriented Programming

undefined

1.

It implies encapsulation.

2.

A superclass object has an IS-A relationship with its subclass.

3.

It implies a virtual method.

4.

A subclass object has an IS-A relationship with its superclass or interface

Q 8 / 85

Object Oriented Programming

undefined

1.

an abstract method

2.

a public internal method

3.

an internal method

4.

a protected internal method

Q 9 / 85

Object Oriented Programming

undefined

1.

Employee currentEmployee = Employee.Create();

2.

Employee currentEmployee = new Employee();

3.

Employee currentEmployee;

4.

Employee currentEmployee = Employee.New();

Q 10 / 85

Object Oriented Programming

undefined

1.

default

2.

copy

3.

parameterized

4.

Constructors do not have a return type

Q 11 / 85

Object Oriented Programming

undefined

1.

when an object is created from a class using the new keyword

2.

when an class is defined using the class keyword

3.

every time an object is referenced

4.

when an object is created from a class using the create keyword

Q 12 / 85

Object Oriented Programming

undefined

1.

when an object is created from a class

2.

when an class is defined using the class keyword

3.

every time an object is referenced

4.

when an object is created from a class using the create keyword

Q 13 / 85

Object Oriented Programming

undefined

1.

The object can be accessed, declared, and used locally in that function.

2.

The object must be declared inside any other function.

3.

The object is temporarily accessible outside the function.

4.

The object can call all the other class members anywhere in the program.

Q 14 / 85

Object Oriented Programming

undefined

1.

do and check

2.

catching and trying

3.

try and catch

4.

do and while

Q 15 / 85

Object Oriented Programming

undefined

1.

It makes it easier to save the entity.

2.

all of these answers

3.

It can make the entity retrieval more efficient

4.

It minimizes coupling.

Q 16 / 85

Object Oriented Programming

undefined

1.

Inheritance describes the ability to create new classes based on an existing class.

2.

Inheritance means that a group of related properties, methods, and other members are treated as a single unit or object.

3.

Inheritance forces a class to have a single responsibility from only one parent.

4.

Inheritance means that you will never have multiple classes that can be used interchangeably, even though each class implements the same properties or methods in different ways.

Q 17 / 85

Object Oriented Programming

undefined

1.

multilevel

2.

hierarchical and multiple

3.

hierarchical

4.

multiple

Q 18 / 85

Object Oriented Programming

undefined

1.

A default parameter's constructor is not equivalent to the default constructor

2.

A default constructor is inherited from a parent class

3.

A default constructor can be called explicitly

4.

A default constructor cannot be defined by the coder

Q 19 / 85

Object Oriented Programming

undefined

1.

Getters and setters can speed up compilation.

2.

Getters and setters provide encapsulation of behavior.

3.

Getters and setters provide a debugging point for when a property changes at runtime.

4.

Getters and setters permit different access levels.

Q 20 / 85

Object Oriented Programming

undefined

1.

Association is a relationship where all objects have their own life cycle and there is no owner.

2.

Association is the process where model elements cooperate to provide higher-level behavior.

3.

Association is whole/part relationship where one object is composed of one or more other objects, each of which is considered a part of the whole.

4.

Association is where all objects have their own life cycle, but there is ownerhip, and child objects can not belong to another parent object.

Q 21 / 85

Object Oriented Programming

undefined

1.

User Stories are shorter and less detailed.

2.

User stories are more accurate.

3.

User stories are more detailed and structured.

4.

User storised are more anecdotal and personal.

Q 22 / 85

Object Oriented Programming

undefined

_NOTE_: Hybrid inheritance is a composition of multiple and hierarchical inheritances

1.

multiple

2.

any type of inheritance

3.

multilevel

4.

hierarchical

Q 23 / 85

Object Oriented Programming

undefined

1.

an object-based language

2.

a class-based language

3.

a procedure-oriented language

4.

if classes are supported, polymorphism will be supported

Q 24 / 85

Object Oriented Programming

undefined

1.

Abstraction is using a private access specifier for data members

2.

Abstraction is using public member functions to access and manipulate the data members

3.

Abstraction is using the class concept with both data members and member functions

4.

There is insufficient information to decide where abstraction is being used.

Q 25 / 85

Object Oriented Programming

undefined

1.

Observer, State, Strategy, Template Method, and Visitor.

2.

Composite, Visitor, State, Prototype, and Singleton.

3.

Composite, Builder, Factory Method, Prototype, and Singleton.

4.

Abstract Factory, Builder, Factory Method, Prototype, and Singleton.

Q 26 / 85

Object Oriented Programming

undefined

1.

one class only

2.

two classes

3.

as many classes as required

4.

at least two classes

Q 27 / 85

Object Oriented Programming

undefined

1.

to the main object of the caller function, too

2.

on the caller function object and also the called function object

3.

on the copy of the object that is made during the pass

4.

only in the local scope of the called function

Q 28 / 85

Object Oriented Programming

undefined

1.

a set of instructions designed to perform a frequently used operation within a program and return no values

2.

the exact same thing as a function and subroutine

3.

a set of variables that can change over time

4.

a procedure associated with data and behaviour

Q 29 / 85

Object Oriented Programming

undefined

1.

camera

2.

display

3.

motherboard

4.

mobile phone

Q 30 / 85

Object Oriented Programming

undefined

1.

the class at the third level

2.

the class at the first level

3.

All have the same degree of abstraction.

4.

the class at the second level

Q 31 / 85

Object Oriented Programming

undefined

1.

multilevel inheritance

2.

double inheritance

3.

single inheritance

4.

hierarchical inheritance

Q 32 / 85

Object Oriented Programming

undefined

1.

The duplication uses unnecessary space.

2.

One has to maintain all the duplicates.

3.

Duplication can cause intellectual property concerns.

4.

Duplication is easy to hide.

Q 33 / 85

Object Oriented Programming

undefined

1.

It is called initially when an object is created and called with every new object instance.

2.

It is called when an object is destroyed and only one time.

3.

It is called initially when an object is created and only one time.

4.

It is created at time when the object is discarded.

Q 34 / 85

Object Oriented Programming

undefined

cpp static void Multiply(int num1, int num2) {}; static void Multiply(double num1, double num2, double num3) {}; static void Multiply(float num1, float num2) {};

1.

polymorphism, because each method can perform different task

2.

method overriding, because it display the same method name, different or same parameters, and same return type

3.

method overloading, because it allows the creation of several methods with the same name, wich differ by the type of input via parameter

4.

method overriding, because it display the same method name, different parameters, and same return type

Q 35 / 85

Object Oriented Programming

undefined

1.

to initialize all the members with static value

2.

to delete the static members when not required

3.

to initialize the static members of class

4.

to clear all the static members' initialized values

Q 36 / 85

Object Oriented Programming

undefined

1.

Code Responsibility Collection cards are a brainstorming tool used in the design of procedural software

2.

Class Responsibility collaboration cards are a brainstorming tool used in the design of oop software

3.

Code Responsibility Correction cards are tools used for debugging

4.

Code Responsibility Correction cards are tools for modeling

Q 37 / 85

Object Oriented Programming

undefined

1.

if one element of an aggregation is dereferenced, all its elements are eligible for garbage collection

2.

if a composition dies, the contents die

3.

the contents of a composition are all siblings

4.

an aggregation contains only abstract classes

Q 38 / 85

Object Oriented Programming

undefined

1.

if one element of an aggregation is dereferenced, all its elements are eligible for garbage collection

2.

if a composition dies, the contents die

3.

the contents of a composition are all siblings

4.

an aggregation contains only abstract classes

Q 39 / 85

Object Oriented Programming

undefined

1.

it can increase code vulnerability

2.

it can make code unsafe

3.

it can limit code readability

4.

it can be safer for coding

Q 40 / 85

Object Oriented Programming

undefined

1.

Member functions can be defined only inside or outside the class body.

2.

Member functions can be made to be friends of another class.

3.

Member functions do not need to be declared inside the class definition.

4.

All member functions need to be defined.

Q 41 / 85

Object Oriented Programming

undefined

_NOTE_: I don't have 4th variant in my test, it changed to new 5th variant. Is it also true?

1.

to protect attributes from unwanted changes

2.

to delegate coding responsibility more efficiently

3.

to conserve memory

4.

to avoid writing duplicate code

5.

to separate class behavior from the more general

Q 42 / 85

Object Oriented Programming

undefined

1.

a name

2.

a state

3.

a color

4.

an object

Q 43 / 85

Object Oriented Programming

undefined

1.

inline function

2.

undefined function

3.

virtual function

4.

class member function

Q 44 / 85

Object Oriented Programming

undefined

1.

leaf and tree

2.

clean, enrage, and collapse

3.

clean, active, and lively

4.

leaf, tree, and trumpet

Q 45 / 85

Object Oriented Programming

undefined

1.

It focuses on objects that interact cleanly with one another.

2.

It programs exclusively to interfaces.

3.

It programs exclusively to classes.

4.

It creates one class for all business logic.

Q 46 / 85

Object Oriented Programming

undefined

1.

No, abstract classes can be used only in single-level inheritance since they must be immediately implemented.

2.

yes, always

3.

yes, but with only one abstract class

4.

No, abstract classes do not have constructors.

Q 47 / 85

Object Oriented Programming

undefined

1.

single level

2.

multilevel

3.

hierarchical

4.

multiple

Q 48 / 85

Object Oriented Programming

undefined

1.

Abstraction is about making relevant information visible, while encapsulation enables a programmer to implement the desired level of abstraction.

2.

Abstraction and encapsulation are essentially the same.

3.

Abstraction and encapsulation are unrelated.

4.

Encapsulation is about making relevant information visible, while abstraction enables a programmer to implement the desired level of encapsulation.

Q 49 / 85

Object Oriented Programming

undefined

1.

abstract and public

2.

public and private

3.

this and final

4.

final and abstract

Q 50 / 85

Object Oriented Programming

undefined

1.

It is the address of variable only -- not the method of an object.

2.

It is a shallow pointer that contains address of an object.

3.

It is the physical address of an object.

4.

It is the address where the variables and methods of an object are stored.

Q 51 / 85

Object Oriented Programming

undefined

1.

Objects may maintain internal state, which is not easily accessible by the tests.

2.

The quality of unit testing frameworks for functional languages is better.

3.

OOP promotes code reuse, which means that your tests have to consider more use cases.

4.

Object-oriented languages tend to rely on frameworks such as Spring or Hibernate, which make them difficult to test.

Q 52 / 85

Object Oriented Programming

undefined

1.

It connects actors to use cases.

2.

It links actors to roles played in all use cases.

3.

It lists all actors for each use case.

4.

It minimizes the number of actors required.

Q 53 / 85

Object Oriented Programming

undefined

1.

Behaviour describe dynamic properties; attributes are static.

2.

Attributes describe a state; behaviours describe a change.

3.

Attributes apply only to a specified object; behaviour apply to other linked objects.

4.

Behaviours are vector quantities; attributes are scalars.

Q 54 / 85

Object Oriented Programming

undefined

1.

refactoring; duplication

2.

modification; duplication

3.

extension; modification

4.

reuse; encapsulation

Q 55 / 85

Object Oriented Programming

undefined

1.

to define a method that must be implemented in a derived class

2.

to define a custom implementation of an inherited member

3.

to define a method that must be implemented in a superclass only

4.

to define a class that can be inherited from

Q 56 / 85

Object Oriented Programming

undefined

1.

It is a unique constructor for creating a new object as a copy of an object that already exists. There will always be only one copy constructor that can be either defined by the user or the system.

2.

It is a constructor that duplicates itself when requested on demand.

3.

It is a common constructor for preventing the creation of a new object as a copy of an object that already exists. There will always be multiple standard constructors that can be either defined by the user or the system.

4.

It is a constructor that duplicates itself on its own, based on memory available.

Q 57 / 85

Object Oriented Programming

undefined

1.

The catch block that will be executed is the one that best matches the type of exception thrown.

2.

Multiple catch blocks can never be associated with a single try block.

3.

Multiple catch blocks are mandatory for each try block.

4.

Multiple catch blocks will all be executed in the case of an exception.

Q 58 / 85

Object Oriented Programming

undefined

1.

A

2.

B

3.

C

4.

C and B

Q 59 / 85

Object Oriented Programming

undefined

1.

Cohesion. A solution is to show that each module has certain responsibilities and to use an anticohesive design pattern.

2.

Encapsulation. A solution is to implement one of the SOLID principles to ensure the modules do not encapsulate with each other.

3.

Coupling. A solution is to refactor the code to be loosely coupled by using inversion of control and dependency injection.

4.

Dependency. A solution is to implement polymorphism and abstraction to change and extract dependent elements of a module so that it functions on its own.

Q 60 / 85

Object Oriented Programming

undefined

1.

A class of resources

2.

A group of methods

3.

A collection of objects

4.

A list of children

Q 61 / 85

Object Oriented Programming

undefined

1.

virtual function

2.

inline function

3.

undefined function

4.

private function

Q 62 / 85

Object Oriented Programming

undefined

1.

loose coupling

2.

code reusability

3.

lazy initialization

4.

data abstraction

Q 63 / 85

Object Oriented Programming

undefined

1.

Yes, the caller function needs to reflect the changes.

2.

No, you should use a global variable instead.

3.

No, changes will be automatically reflected in the calling function.

4.

Yes, the object must be the same in the caller function.

Q 64 / 85

Object Oriented Programming

undefined

Q 65 / 85

Object Oriented Programming

undefined

1.

car:toyota

2.

ducks:pond

3.

toes:feet

4.

rock:stone

Q 66 / 85

Object Oriented Programming

undefined

1.

Memento notifies multiple classes of changes. Observer captures and restores an object's internal state.

2.

Memento defers the exact steps of an algorithm to a subclass. Observer defines a new operation to a class without change.

3.

Memento alters an object's behavior when its state changes. Observer encapsulates an algorithm inside a class.

4.

Memento captures and restores an object's internal state. Observer notifies multiple classes of changes.

Q 67 / 85

Object Oriented Programming

undefined

1.

a default value of the Coordinate attribute

2.

the size of the position array

3.

an increment of the position attribute value

4.

a default value of the position attribute

Q 68 / 85

Object Oriented Programming

undefined

public class Car{ } public class FlyingCars extends Car{ public void fly(){} } public class Tesla FlyingCar{} public class Honda Car{} public class Car{ public void fly(){} } public class Tesla extends Car{} public class Honda extends Car{} public class Car{ public void fly(){} } public class Tesla Car{} public class Honda Car{} public class Car{ } public class FlyingCars extends Car{ public void fly(){} } public class Tesla extends FlyingCar{} public class Honda extends Car{}

1.

public class Car{ } public class FlyingCars extends Car{ public void fly(){} } public class Tesla FlyingCar{} public class Honda Car{}

2.

public class Car{ public void fly(){} } public class Tesla extends Car{} public class Honda extends Car{}

3.

public class Car{ public void fly(){} } public class Tesla Car{} public class Honda Car{}

4.

public class Car{ } public class FlyingCars extends Car{ public void fly(){} } public class Tesla extends FlyingCar{} public class Honda extends Car{}

Q 69 / 85

Object Oriented Programming

undefined

1.

An argument can have many values while a parameter can have only one value.

2.

An argument is the variable used for input values in a method. A parameter is the specific input value passed to the method.

3.

A parameter is a variable in the declaration of a function. An argument is the value of this variable that gets passed to the function.

4.

Parameters and arguments are the same

Q 70 / 85

Object Oriented Programming

undefined

> Explanation: It depends on the access specifier and the type of inheritance used with the class, because if the class is inherited then the nested class can be used by subclass too, provided it’s not of private type.

1.

Protected scope

2.

Private scope

3.

Global scope

4.

Depends on access specifier and inheritance used

Q 71 / 85

Object Oriented Programming

undefined

1.

a collection

2.

a variable

3.

a class

4.

a procedure

Q 72 / 85

Object Oriented Programming

undefined

1.

Multilevel

2.

Hybrid

3.

Single level

4.

Multiple

Q 73 / 85

Object Oriented Programming

undefined

1.

All of these answers

2.

Applications are decomposed into parts

3.

Parts are defined with minimal overlap

4.

Each part is responsible for a separate concern

Q 74 / 85

Object Oriented Programming

undefined

1.

To always run the finally block of code when the try block exits

2.

To run code when an exception has not occurred

3.

To run the block if an exception occurred

4.

To run code whenever garbage collection requires it

Q 75 / 85

Object Oriented Programming

undefined

1.

C#

2.

Java

3.

C

4.

Python

Q 76 / 85

Object Oriented Programming

undefined

1.

To relinquish resources that are no longer needed

2.

To delete a variable name

3.

To reset an attribute value

4.

To hold space, even after an object is no longer being used

Q 77 / 85

Object Oriented Programming

undefined

1.

Protected class

2.

Base class

3.

Anonymous class

4.

Abstract class

Q 78 / 85

Object Oriented Programming

undefined

1.

Composition is the act of one object passing to another object an operation to be performed on behalf of the initial object.

2.

Composition is a part/hole relationship where an object is composed of one or more other objects, each of which is considered a part of the whole.

3.

Composition is a binding where the class/name association is not made until the object designated by the name is created at execution time

4.

Composition is a process of collecting classes that provide a set of services for a particular domain

Q 79 / 85

Object Oriented Programming

undefined

1.

overloading

2.

inheritance

3.

abstraction

4.

overriding

Q 80 / 85

Object Oriented Programming

undefined

1.

parents

2.

pure virtual functions

3.

attributes

4.

purposes

Q 81 / 85

Object Oriented Programming

undefined

1.

It can be difficult to identify variables that are incorrectly typed

2.

The dynamic variables can assume only limited values

3.

Storage is fixed for dynamic variables

4.

Static variables are more flexible than dynamic variables

Q 82 / 85

Object Oriented Programming

undefined

1.

Early binding is when a variable is assigned a value when a scope is created. Late binding is when a variable is assigned a value after a scope is exited

2.

Early binding is when a variable is assigned a value when the program starts. Late binding is when a variable is assigned after the program is running

3.

There is no difference. In both cases, variables are assigned values when a program has completed startup and is running

4.

Early binding is when a variable is assigned its value at compile time. Late binding is when a variable is assigned a value at run time

Q 83 / 85

Object Oriented Programming

undefined

1.

Interfaces can contain code or data. Abstract classes do not contain code or data. A class can inherit from more than one abstract class but can only implement one interface

2.

Interfaces can contain code or data. Abstract classes do not contain code or data. A class can inherit from only one abstract class but can implement an unlimited number of interface

3.

Abstract classes can contain code or data. Interface do not contain code or data. A class can inherit from only one abstract class but can implement an unlimited number of interfaces

4.

Abstract classes can contain code or data. Interface do not contain code or data. A class can inherit from more than one abstract class but can only implement one interface

Q 84 / 85

Object Oriented Programming

undefined

`Here they haven't mentioned any specific language so let's consider all languages.`

1.

reference to subclass // References to subclass are never required as you can simply Initialize subclass & use their object.

2.

reference to base class // References to the base class are not required in Java, Javascript & Python

3.

reference to this pointer // While Python & Javascript may require passing this or self in the constructor, It is not passed in Java constructor.

4.

none // Above 3 are incorrect so "none" is the answer

Q 85 / 85