0% found this document useful (0 votes)
82 views66 pages

OOP and Design Patterns Quiz

The document appears to be a 10 question quiz on topics related to object-oriented programming concepts from Unit 1 and Unit 2, including abstract data types, features of OOP, inheritance, polymorphism, and exception handling. It includes multiple choice questions with one answer selected as correct for each. The questions cover basic terminology and applications of key OOP principles.

Uploaded by

vicky
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
82 views66 pages

OOP and Design Patterns Quiz

The document appears to be a 10 question quiz on topics related to object-oriented programming concepts from Unit 1 and Unit 2, including abstract data types, features of OOP, inheritance, polymorphism, and exception handling. It includes multiple choice questions with one answer selected as correct for each. The questions cover basic terminology and applications of key OOP principles.

Uploaded by

vicky
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 66

10/18/21, 11:42 AM Test 6: Unit1 and Unit 2

Test 6: Unit1 and Unit 2


No. of Questions: 10 Time : 10 Minutes

[email protected] Switch account

Draft saved

Your email will be recorded when you submit this form

* Required

A mathematical-model with a collection of operations defined on that 1 point

model is called *

Algorithm

Data Structure

Primitive Data Type

Abstract Data Type

Which one is not a feature of OOP * 1 point

Classes

Objects

Data Abstraction

All are the features of OOP

https://docs.google.com/forms/d/e/1FAIpQLSdk_kKDeznboWR8suYC0VsjZ4ndOM8cZQyJfhTfvLUKRh2vnw/viewform 1/5
10/18/21, 11:42 AM Test 6: Unit1 and Unit 2

Which among the following can be viewed as combination of abstraction 1 point


of data and code ? *

None

Class

Object

Interfaces

Which rule of Substitute Principle ensures that 'if a program is type-correct 1 point

based on the super-type specification, it is also type-correct with respect


to the subtype specification' *

The signature rule

The methods rule

The properties rule

None

1 point

Queue

1 point

Option 1

https://docs.google.com/forms/d/e/1FAIpQLSdk_kKDeznboWR8suYC0VsjZ4ndOM8cZQyJfhTfvLUKRh2vnw/viewform 2/5
10/18/21, 11:42 AM Test 6: Unit1 and Unit 2

If different properties and functions of a real world entity is grouped or 1 point

embedded into a single element, what is it called in OOP language? *

Abstraction

Inheritance

Encapsulation

Polymorphism

1 point

Option 1

1 point

Option 1

Which is not feature of OOP in general definitions? * 1 point

Efficient Code

Duplicate/Redundant data

Modularity

Code reusability

https://docs.google.com/forms/d/e/1FAIpQLSdk_kKDeznboWR8suYC0VsjZ4ndOM8cZQyJfhTfvLUKRh2vnw/viewform 3/5
10/18/21, 11:42 AM Test 6: Unit1 and Unit 2

Which is true about decomposing a problem * 1 point

Good understanding of problem is required to decompose

It is not easy to maintain modules after decomposition

Solutions to sub problems always provide solution to main problem

Parallelization is not possible in solving sub problems

1 point

Option 1

Which feature of OOP encourage Reusability * 1 point

Polymorphism

Inheritance

Abstraction

Encapsulation

Activity of ensuring that the operands of an operation are of compatible 1 point


types is called *

Type Casting

Type Hierarchy

None

Type Checking

https://docs.google.com/forms/d/e/1FAIpQLSdk_kKDeznboWR8suYC0VsjZ4ndOM8cZQyJfhTfvLUKRh2vnw/viewform 4/5
10/18/21, 11:42 AM Test 6: Unit1 and Unit 2

Writing 'Cube(x)' instead of ' x*x*x' is the type of * 1 point

Procedural Abstraction

Data Abstraction

Iteration Abstraction

None

Page 1 of 1

Submit Clear form

This form was created inside of JC Bose University of Science and Technology, YMCA Faridabad. Report Abuse

 Forms

https://docs.google.com/forms/d/e/1FAIpQLSdk_kKDeznboWR8suYC0VsjZ4ndOM8cZQyJfhTfvLUKRh2vnw/viewform 5/5
12/21/21, 10:49 AM Unit -2 Features of OOP Test

Unit -2 Features of OOP Test Total points 12/15

No of Questions: 15 Marks: 15 Duration : 15 Minutes

The respondent's email ([email protected]) was recorded on submission of


this form.

Which of the following is a mechanism of static ? * 1/1

All

Function overloading

Templates

Operator overloading

Global variables and static variables are kept in * 1/1

Code Segment

Heap

Data Segment

Stack

https://docs.google.com/forms/d/e/1FAIpQLSd8Oso4MlVrHvpZhwmCwoG8t3D_e6w-yC7A9OXwOyMqUGNfBQ/viewscore?vc=0&c=0&w=1&flr=0… 1/6
12/21/21, 10:49 AM Unit -2 Features of OOP Test

In oops public, private & protected are * 1/1

Interfaces

Access Modifiers

Method signature

Classes

" obj.this" is similar to * 0/1

->obj

*obj

&obj

none

Correct answer

&obj

Which inheritance type is used in the class given below? class A : public 1/1
X, public Y *

Hierarchical Inheritance

Hybrid inheritance

Multilevel inheritance

Multiple inheritance

https://docs.google.com/forms/d/e/1FAIpQLSd8Oso4MlVrHvpZhwmCwoG8t3D_e6w-yC7A9OXwOyMqUGNfBQ/viewscore?vc=0&c=0&w=1&flr=0… 2/6
12/21/21, 10:49 AM Unit -2 Features of OOP Test

When private member of base class is inherited protected in derived 0/1


class , it become *

public in derived class

private in derived class

protected e in derived class

Not accessible

Correct answer

Not accessible

A template class can have ...... * 1/1

At most two data types

Only one generic data type

More than one generic data type

Only generic type of integers and not characters

Which of the following is universal class for exception handling? * 1/1

Errors

Catch

Exceptions

Try

https://docs.google.com/forms/d/e/1FAIpQLSd8Oso4MlVrHvpZhwmCwoG8t3D_e6w-yC7A9OXwOyMqUGNfBQ/viewscore?vc=0&c=0&w=1&flr=0… 3/6
12/21/21, 10:49 AM Unit -2 Features of OOP Test

The feature by which one object can interact with another object is...... * 1/1

Data transfer

Message Passing

Message reading

Data Binding

In " Protected " access specifier * 1/1

Members are accessible from outside the class

Members cannot be accessed from outside the class

Members can be accessed in inherited classes

Members can be accessed from next inherited class only

How many catch blocks you can use with single Try block? * 1/1

Only 2

Only 1

As many as required

Maximum 256

https://docs.google.com/forms/d/e/1FAIpQLSd8Oso4MlVrHvpZhwmCwoG8t3D_e6w-yC7A9OXwOyMqUGNfBQ/viewscore?vc=0&c=0&w=1&flr=0… 4/6
12/21/21, 10:49 AM Unit -2 Features of OOP Test

Which of the following concepts means wrapping up of data and 1/1


functions together? *

Encapsulation

Polymorphism

Inheritance

Abstraction

Which of the following is an abstract data type? * 1/1

String

Int

Class

Double

Find out the right statement * 0/1

Java and C++ supports Dynamic type checking

Python and VBScript supports Static type checking

Python and VBScript supports Dynamic type checking

Java and C# supports Dynamic type checking

Correct answer

Python and VBScript supports Dynamic type checking

https://docs.google.com/forms/d/e/1FAIpQLSd8Oso4MlVrHvpZhwmCwoG8t3D_e6w-yC7A9OXwOyMqUGNfBQ/viewscore?vc=0&c=0&w=1&flr=0… 5/6
12/21/21, 10:49 AM Unit -2 Features of OOP Test

Which of the following is correct about function overloading? * 1/1

D. Both A and B

C. The number of argument is same.

B. The order of argument is different.

A. The types of arguments are different.

This form was created inside of JC Bose University of Science and Technology, YMCA Faridabad.

 Forms

https://docs.google.com/forms/d/e/1FAIpQLSd8Oso4MlVrHvpZhwmCwoG8t3D_e6w-yC7A9OXwOyMqUGNfBQ/viewscore?vc=0&c=0&w=1&flr=0… 6/6
11/18/21, 10:26 AM Test -Unit -3, Design Patterns

Test -Unit -3, Design Patterns


Questions : 10 Duration : 10 Minutes

[email protected] Switch account

Draft saved

Your email will be recorded when you submit this form

* Required

Which Factory Method pattern uses inheritance and relies on a subclass to 1 point

handle the desired object instantiation *

None

Factory Method

Bridge

Abstract Factory Method

Define one to many dependency between objects so that when one object 1 point

change state, all its dependent are notified and updated automatically *

Observer

MVC Design Pattern

Bridge

Singleton

https://docs.google.com/forms/d/e/1FAIpQLSfsGVixl-KV0KAMfJQdInTCNbBRp8wM5WgxuBJye0F7CvNj3Q/viewform 1/4
11/18/21, 10:26 AM Test -Unit -3, Design Patterns

Define an interface for creating an object, but let the subclasses decide 1 point
which class to instantiate. It let the instantiation differ to subclasses *

Abstract Factory

Factory Method

Bridge

Singleton

Which of the following is correct about Singleton design pattern. * 1 point

This pattern involves a single class which is responsible to create an object while
making sure that only single object gets created.

Singleton class provides a way to access its only object which can be accessed
directly without need to instantiate the object of the class.

This type of design pattern comes under creational pattern.

All of the above.

Which of the following is true about the Bridge pattern correctly * 1 point

A - This pattern builds a complex object using simple objects and using a step by step
approach.

B - You can create platform independent classes and apps

C - This pattern is used when we need to decouple an abstraction from its


implementation so that the two can vary independently.

D - Both B & C

E- Both A & D

https://docs.google.com/forms/d/e/1FAIpQLSfsGVixl-KV0KAMfJQdInTCNbBRp8wM5WgxuBJye0F7CvNj3Q/viewform 2/4
11/18/21, 10:26 AM Test -Unit -3, Design Patterns

Which of the following is correct about Behavioral design patterns. * 1 point

None of the above.

These design patterns provide a way to create objects while hiding the creation logic,
rather than instantiating objects directly using new opreator.

These design patterns are specifically concerned with communication between


objects.

These design patterns concern class and object composition. Concept of inheritance
is used to compose interfaces and define ways to compose objects to obtain new
functionalities.

Which of the following pattern is used to get a way to access the elements 1 point

of a collection object in sequential manner without any need to know its


underlying representation? *

Iterator Pattern

Observer Pattern

Abstract Factory Method

None

Find the true Statement * 1 point

In Factory Method you can introduce new abstractions and implementations


independently from each other

Observer Pattern provide a way to access the elements of an aggregate object


sequentially without exposing its underlying representation

Bridge pattern has become popular for designing web applications.

Flyweight Pattern used when the application does not depend on object identity

https://docs.google.com/forms/d/e/1FAIpQLSfsGVixl-KV0KAMfJQdInTCNbBRp8wM5WgxuBJye0F7CvNj3Q/viewform 3/4
11/18/21, 10:26 AM Test -Unit -3, Design Patterns

Which of the following is correct list of classifications of design patterns. * 1 point

Creational, Structural and Behavioral patterns.

None of the above.

Creational, Executional and Behavioral patterns.

Executional, Structural and Behavioral patterns.

Which of the following is true about design patterns? * 1 point

All of the above.

Design patterns are obtained by trial and error by numerous software developers over
quite a substantial period of time.

Design patterns are solutions to general problems that software developers faced
during software development.

A - Design patterns represent the best practices used by experienced object-oriented


software developers.

Page 1 of 1

Submit Clear form

This form was created inside of JC Bose University of Science and Technology, YMCA Faridabad. Report Abuse

 Forms

https://docs.google.com/forms/d/e/1FAIpQLSfsGVixl-KV0KAMfJQdInTCNbBRp8wM5WgxuBJye0F7CvNj3Q/viewform 4/4
12/21/21, 10:48 AM Unit-4 Test

Unit-4 Test
Time: 10 Minutes No. Of Questions: 10 Marks: 10

The respondent's email ([email protected]) was recorded on submission of


this form.

Which is wrong about Generic programming ? *

Algorithms are written in terms of types to-be-specified-later

Problems are checked at runtime

There is no need to typecast the object.

We can hold only a single type of objects in generics

Set<Integer> a = new HashSet<Integer>(); Here 'integer' is the

Type of Object of 'Set'

Type of Object of 'HashSet'

Type of Variable 'a'

None

https://docs.google.com/forms/d/e/1FAIpQLScmsMCsfXXF6cSMOATYRt8hZymteoVxCXfrQ5hndJJJ6CAfMw/viewscore?vc=0&c=0&w=1&flr=0&vi… 1/4
12/21/21, 10:48 AM Unit-4 Test

Which class uses Generics *

HashMap

ArrayList

HashSet

All the above

None

Which of these is wildcard symbol? *

&

Queue interface is implemented by

LinkedList Class only

PriorityQueue class only

Both LinkedList and PriorityQueue classes

ArrayDqueue and LinkedList classes

https://docs.google.com/forms/d/e/1FAIpQLScmsMCsfXXF6cSMOATYRt8hZymteoVxCXfrQ5hndJJJ6CAfMw/viewscore?vc=0&c=0&w=1&flr=0&vi… 2/4
12/21/21, 10:48 AM Unit-4 Test

Find the wrong statement *

If T<:U, and a program expects a value of type U, then one can substitute a value of
type T in its place

All are true

If 'Integer' and 'Float' are the subtype of 'Number' then 'Integer' and 'Float' are
subtypes of each other.

Subtyping is the form of Polymorphism

Which of these does not allow null keys *

HashMap

LinkedHashMap

TreeMap

All allow

Generic programming is implemented in C++ with the help of .... *

None

Templates

Function Overloading

Type Casting

https://docs.google.com/forms/d/e/1FAIpQLScmsMCsfXXF6cSMOATYRt8hZymteoVxCXfrQ5hndJJJ6CAfMw/viewscore?vc=0&c=0&w=1&flr=0&vi… 3/4
12/21/21, 10:48 AM Unit-4 Test

What will happen if you try to store a key which is already present in HashMap *

A duplicate key will created

None is true

it will override the old value with the new value

An exception will arise

Keywords used to upper bound and lower bound a wildcard *

Implements and Expends

Upper and Lower

Super and Extends

Extends and Super

This form was created inside of JC Bose University of Science and Technology, YMCA Faridabad.

 Forms

https://docs.google.com/forms/d/e/1FAIpQLScmsMCsfXXF6cSMOATYRt8hZymteoVxCXfrQ5hndJJJ6CAfMw/viewscore?vc=0&c=0&w=1&flr=0&vi… 4/4
12/21/21, 10:47 AM Unit-5 Test

Unit-5 Test Total points 8/10

Time: 10 Minutes No. Of Questions: 10 Marks: 10

The respondent's email ([email protected]) was recorded on submission of


this form.

What Method Is Used To Specify A Container's Layout? * 1/1

setFrame()

setLayout()

SetWindow()

setContainer()

What will happen if you try to store a key which is already present in 1/1
HashMap *

None is true

it will override the old value with the new value

A duplicate key will created

An exception will arise

https://docs.google.com/forms/d/e/1FAIpQLSfksTZs5WnyhwvNm_8Jrwu08cTzYlsKQnW5bW8JRvl802VXjw/viewscore?vc=0&c=0&w=1&flr=0&vie… 1/4
12/21/21, 10:47 AM Unit-5 Test

Find the right statement * 1/1

ScrollBar is a Container

A ScrollPane handles its own events and performs its own scrolling

ScrollPane is a component

All are true

Swing components are called lightweight components because * 0/1

Swing components use the screen resource of an ancestor instead of having their
own

None

Swing components are associated with native screen resource

it is generated by the system’s host operating system

Correct answer

Swing components use the screen resource of an ancestor instead of having their
own

Which is not true about Card Layout * 1/1

It manages the components in such a manner that only one component is visible at
a time

creates a card layout with zero horizontal and vertical gap

. It treats each component as a card

All are true

https://docs.google.com/forms/d/e/1FAIpQLSfksTZs5WnyhwvNm_8Jrwu08cTzYlsKQnW5bW8JRvl802VXjw/viewscore?vc=0&c=0&w=1&flr=0&vie… 2/4
12/21/21, 10:47 AM Unit-5 Test

Changing the state of an object in Swing is called * 1/1

Event

Response

Action

Event Handler

An object that is used to organize components in a container * 0/1

Layout Manager

Layout

None

Container Manager

Correct answer

Layout Manager

Concurrency in swing is achieved by : * 1/1

Process

threads

both

none

https://docs.google.com/forms/d/e/1FAIpQLSfksTZs5WnyhwvNm_8Jrwu08cTzYlsKQnW5bW8JRvl802VXjw/viewscore?vc=0&c=0&w=1&flr=0&vie… 3/4
12/21/21, 10:47 AM Unit-5 Test

Which of these does not allow null keys * 1/1

HashMap

LinkedHashMap

TreeMap

All allow

Queue interface is implemented by 1/1

LinkedList Class only

PriorityQueue class only

Both LinkedList and PriorityQueue classes

ArrayDqueue and LinkedList classes

This form was created inside of JC Bose University of Science and Technology, YMCA Faridabad.

 Forms

https://docs.google.com/forms/d/e/1FAIpQLSfksTZs5WnyhwvNm_8Jrwu08cTzYlsKQnW5bW8JRvl802VXjw/viewscore?vc=0&c=0&w=1&flr=0&vie… 4/4
Q1. The correct way of inheritance for Dog and Animal is:
a. Class Dog :public Animal
b. Class Animal : public Dog
c. Both
d. None
Ans: a
Q2. A private member of a class is visible to:
a. Everywhere
b. In sub class
c. Members to same package
d. Only members of same class
Ans: d

Q3. Polymorphism is extensively used in implementing:


a. Inheritance
b. Abstraction
c. Encapsulation
d. Dynamic binding
Ans: a
Q4. Dynamic Binding is also known as:
a. Early Binding
b. Late Binding
Ans b
Q5. Which of the following are not tokens:
a. Keywords
b. Operators
c. Constants
d. Functions
Ans: d
Q6. Which of the following is true?
a. All objects of a class share all data members of class.
b. Objects of a class do not share non-static members. Every object has its own copy.
c. Objects of a class do not share codes of non-static methods, they have their own copy
d. None of the above
Ans b
Q7. “Static data member is initialized by zero. No other initialization is allowed. “State whether
this statement is true or false.
a. True
b. False
Ans a

Q8. A member function will accept two argument in case of binary operator overloading. State
whether this statement is true or false.
a. True
b. False
Ans b

Q9. Which of the following is correct about friend functions?


a. Friend functions use the dot operator to access members of a class using class objects.
b. Friend functions can be private or public
c. Friend cannot access the members of the class directly
d. All of the mentioned
Ans d

Q10. What happens if a user forgets to define a constructor inside a class?


a) Error occurs
b) Segmentation fault
c) Objects are not created properly
d) Compiler provides a default constructor to avoid faults/errors
Ans d

Q11. What is syntax of defining a destructor of class A?


a) A(){}
b) ~A(){}
c) A::A(){}
d) ~A(){};
Ans b

Q12. Which of the following is true about constructors. 1) They cannot be virtual. 2) They
cannot be private. 3) They are automatically called by new operator.
a. All 1, 2, and 3
b. Only 1 and 3
c. Only 1 and 2
d. Only 2 and 3
Ans b

Q 13. Constructors have _____ return type.


a. Void
b. Char
c. Int
d. No
Ans d

Q14. Implicit return type of a class constructor is:


a. not of class type itself
b. class type itself
c. a destructor of class type
d. a destructor not of class type
Ans b

Q15. Like constructors, can there be more than one destructors in a class?

A. Yes
B. No
Ans b
Operator overloading and Inheritance

Q1. Which of the following operators cannot be overloaded


a. . (Member Access or Dot operator)
b. ?: (Ternary or Conditional Operator )
c. :: (Scope Resolution Operator)
d. .* (Pointer-to-member Operator )
e. All of the above

Ans. e
Q2. While overloading binary operators using member function, it requires ___ argument/s.
a. Zero
b. One
c. Two
d. Three
Ans. B

Q3. Scope resolution operator is used______ .


a. to resolve the scope of global variables only
b. to resolve the scope of functions of the classes only
c. to resolve scope of global variables as well as functions of the classes
d. None of these
Ans. c

Q4. What is operator overloading in C++?


a) Overriding the operator meaning by the user defined meaning for user defined data type
b) Redefining the way operator works for user defined types
c) Ability to provide the operators with some special meaning for user defined data type
d) All of the mentioned
Ans. D
Q5. What is the syntax of overloading operator + for class A?
a) A operator+(argument_list){}
b) A operator[+](argument_list){}
c) int +(argument_list){}
d) int [+](argument_list){}
Ans. A

Q6. Operator overloading is also called …………….. polymorphism.


A) run time
B) initial time
C) compile time
D) completion time
Ans. C
Q7. When using ………………., overloaded through a member function, the left-hand operand must
be an object of the relevant class.
A) Unary operators
B) Binary operators
C) Arithmetic operators
D) Function operator
Ans. B

Q8. To perform the conversion from any other data type or class to a class type, a ………….. should
be used in the destination class.
A) casting operator
B) constructor
C) not applicable
D) operator function
Ans. B

Q9. Which type of inheritance leads to diamond problem?


a) Single level
b) Multi-level
c) Multiple
d) Hierarchical

Ans.:c c
Explanation: When 2 or more classes inherit the same class using multiple inheritance and then
one more class inherits those two base classes, we get a diamond like structure. Here, ambiguity
arises when same function gets derived into 2 base classes and finally to 3rd level class because
same name functions are being inherited.

Q10. While inheriting a class, if no access mode is specified, then which among the following is
true? (in C++)
a) It gets inherited publicly by default
b) It gets inherited protected by default
c) It gets inherited privately by default
d) It is not possible
Answer: c
Q11. If a base class is inherited in protected access mode then which among the following is
true?
a) Public and Protected members of base class becomes protected members of derived class
b) Only protected members become protected members of derived class
c) Private, Protected and Public all members of base, become private of derived class
d) Only private members of base, become private of derived class

Answer: a

Q12. If base class has constructor with arguments, then it is ________________ for the derived
class to have constructor and pass the arguments to base class constructor.
a. Optional
b. Mandatory
c. Compiler dependent
d. Error
Ans. b

Q13. In case of inheritance where both base and derived class are having constructor and
destructor, then which if the following are true ?
1. Constructors are executed in their order of derivation
2. Constructors are executed in reverse order of derivation
3. Destructors are executed in their order of derivation
4. Destructors are executed in reverse order of derivation
a. Only 2 ,4
b. Only 1 , 3
c. Only 1 , 4
d. Only 2, 3

Ans. C

Q14. When a base class is privately inherited by derived class public members of the base class can
only be accessed by the ……… of the derived class.
A) non-member functions
B) friend functions
C) member functions
D) class members

Ans. C

Q15. What will be the order of execution of base class constructors in the following method of
inheritance?
class A: public B, public C {….};
A) B(); C(); A();
B) C(); B(); A();
C) A(); B(); C();
D) B(); A(); C();

Ans. A
Templates, Exception handling and Last unit

Q1 What is the advantage of exception handling ?

1. Remove error-handling code from the software's main line of code.


2. A method writer can chose to handle certain exceptions and delegate others to the caller.
3. An exception that occurs in a function can be handled anywhere in the function call stack.
a. Only 1
b. 1, 2 and 3
c. C. 1 and 3
d. 1 and 2
Ans. B

Q2. Which of the following is true about exception handling in C++? 1) There is a
standard exception class like Exception class in Java. 2) All exceptions are unchecked
in C++, i.e., compiler doesn't check if the exceptions are caught or not. 3) In C++, a
function can specify the list of exceptions that it can throw using comma separated list
like following.
void fun(int a, char b) throw (Exception1, Exception2, ..)
a. 1 and 3
b. 1 and 2
c. 2 and 3
d. 1, 2 and 3

Ans. D

Q3. Which statement is used to catch all types of exceptions?


a) catch()
b) catch(Test t)
c) catch(…)
d) catch(Test)
Ans. C
Q4. What is an exception in C++ program?
a) A problem that arises during the execution of a program
b) A problem that arises during compilation
c) Also known as the syntax error
d) Also known as semantic error
Ans. A

Q5. What is the difference between error and exception?


a) Both are the same
b) Errors can be handled at the run-time but the exceptions cannot
c) Exceptions can be handled at the run-time but the errors cannot
d) Both can be handled during run-time
Ans. C

Q6. Which of the following is true about templates.


1) Template is a feature of C++ that allows us to write one code for different data types.

2) We can write one function that can be used for all data types including user defined
types. Like sort(), max(), min(), ..etc.

3) We can write one class or struct that can be used for all data types including user
defined types. Like Linked List, Stack, Queue ..etc.

4) Template is an example of compile time polymorphism.


a. 1 and 2
b. 1, 2 and 3
c. 1, 2 and 4
d. 1, 2, 3 and 4
Ans. D

Q7. Which of the following is incorrect in C++ ? (1)When we write overloaded function
we must code the function for each usage. (2)When we write function template we code
the function only once. (3)It is difficult to debug macros (4)Templates are more efficient
than macros
A. 1 and 2
B. 1, 2 and 3
C. 3 and 4
D. None of them
Ans. D bcoz all are correct

Q8. . What is a template?

A. A template is a formula for creating a generic class


B. A template is used to manipulate the class
C. A template is used for creating the attributes
D. None of the above
Ans. A
Q9. Templates are also called as

1 Generic programming

2. Parameterized class and functions

3 Encapsulation

a. Only 1 and 2
b. Only 1 and 3
c. 1, 2 and 3
d. None

Ans. A

Q10. Can we overload template functions?

a. Yes
b. No

Ans. A

Q11. The key considerations involved in the feasibility analysis is/are


A. Economic
B. Technical
C. Behavioral
D. All of the above
Ans. D

Q12. In ………… stage of SDLC, training of the user staff, system documentation and implementation is
done.
A. system design
B. system implementation
C. system analysis
D. system development
Ans. B

Q13. Waterfall model is not suitable for:

A. Small projects
B. Complex projects
C. Accommodating changes
D. Maintenance Projects
Ans. C

Q14. Which activity is carried out first?

a. Verification
b. Validation
c. Both
d. None
Ans. A

Q15. Which of the following is / are a phases of SDLC?


a. Requirement gathering
b. Maintenance
c. Analysis
d. Testing
e. All of the above

Ans. E
Unit – 1, 5
Q1. Which of these is an example of decomposition?
a) Breaking the problem of organising a cake sale into smaller parts, such as who will
bake the cakes and when to hold the cake sale.
b) Taking the problem of baking a cake and thinking about how we can make it the best
cake possible.
c) Looking at what different kinds of cake can be made.
Ans a

Q2. While decomposing a problem, what is considered?


a) Level of detail of subproblems
b) Dependency of subproblems
c) Solution to subproblems can be combined to solve original problem
d) All of them
Ans d

Q3. Which of the following is not a kind of abstraction?


a) Data Abstraction
b) Iteration Abstraction
c) Specification Abstraction
d) Type Hierarchy
Ans c

Q4. Can we create object of Abstract class?


a) Yes
b) No
Ans b

Q5. Predict the output of following program.


#include<iostream>
using namespace std;
class Base
{
public:
virtual void show() = 0;
};

class Derived : public Base { };

int main(void)
{
Derived q;
return 0;
}
a) Compiler Error: there cannot be an empty derived class
b) Compiler Error: Derived is abstract
c) No compiler Error
Ans b

Q6. Which is the container that doesn't contain title bar and MenuBars but it can have
other components like button, textfield etc?
a. Window
b. Frame
c. Panel
d. Container

ANS. C

Q7. The following specifies the advantages of _____


It is lightweight.
It supports pluggable look and feel.
It follows MVC (Model View Controller) architecture.

a) Swing
b) AWT
c) Both a and b
d) None of the above

Ans. A

Q8. Swing is a part of JFC (Java Foundation Classes) that is used to create GUI application.
a) True
b) False
Ans. True

Q9. The ActionListener interface is not used for handling action events.
a) True
b) False
Ans. False

Q10. Which of these packages contains all the classes and methods required for even
handling in Java?
java.applet

b. java.awt

c. java.event
d. java.awt.event
Ans. D

Q11. What is a listener in context to event handling?

a) A listener is a variable that is notified when an event occurs.


b) A listener is a object that is notified when an event occurs.
c) A listener is a method that is notified when an event occurs.
d) None of the mentioned
Answer: b

Q12. Which of these events is generated when a button is pressed?

a. ActionEvent

b. KeyEvent

c. WindowEvent

d. AdjustmentEvent
Ans. A

Q13. What is an event in delegation event model used by Java programming language?

a) An event is an object that describes a state change in a source.


b) An event is an object that describes a state change in processing.
c) An event is an object that describes any change by the user and system.
d) An event is a class used for defining object, to create events.
Answer: a

Q14. Give the abbreviation of AWT?


a. Applet Windowing Toolkit
b. Abstract Windowing Toolkit
c. Absolute Windowing Toolkit
d. None of the above
Ans. B
Q15. The Following steps are required to perform

1) Implement the Listener interface and overrides its methods


2) Register the component with the Listener

a. Exception Handling
b. String Handling
c. Event Handling
d. None of the above
Ans c
Unit 3, 4

1) Which of the following pattern creates object without exposing the creation logic to the
client and refer to newly created object using a common interface?

A. Factory Pattern
B - Abstract Factory Pattern
C - Singleton Pattern
D - Transfer Object Pattern

Ans A

2) Which of these is wildcard symbol?


a) ?
b) !
c) %
d) &
Ans a

3) Which of these is an correct way making a list that is upper bounded by class
Number?
a) List<? extends Number>
b) List<extends ? Number>
c) List(? extends Number)
d) List(? UpperBounds Number)
Ans A

4) What is Collection in Java?

• A. A group of objects

• B. A group of classes

• C. A group of interfaces

• D. None of the mentioned

Ans A

5) Which of the following is correct about Singleton design pattern.


A - This type of design pattern comes under creational pattern.
B - This pattern involves a single class which is responsible to create an object while making
sure that only single object gets created.
C - Singleton class provides a way to access its only object which can be accessed directly
without need to instantiate the object of the class.
D - All of the above.
Ans D

6) Which of the following describes the Structural pattern correctly?


A - This type of patterns provide a way to create objects while hiding the creation logic, rather
than instantiating objects directly using new opreator
B - This type of patterns concern class and object composition. Concept of inheritance is used
to compose interfaces and define ways to compose objects to obtain new functionalities.
C - This type of pattern are specifically concerned with communication between objects.
D - This type of pattern are specifically concerned with the presentation tier.
Ans B
7) Which of these interface handle sequences?

• A. Set

• B. List

• C. Comparator

• D. Collection

Ans B

8) Which of these interface is not a part of Java's collection framework?

• A. List

• B. Set

• C. SortedMap

• D. SortedList

Ans D

9) Which of these is Basic interface that all other interface inherits?

• A. Set

• B. Array

• C. List

• D. Collection

Ans D
10) Which of these methods can randomize all elements in a list?

• A. rand()

• B. randomize()

• C. shuffle()

• D. ambigous()

Ans C

11) MVC stand for:

• A. Model-View-Controller.
• B.Modern-View-Controller.
• C.Model-View-Constant.
• D.None of these

Ans A

12) Which of the following is correct about Creational design patterns.


A - These design patterns are specifically concerned with communication between objects.
B - These design patterns provide a way to create objects while hiding the creation logic,
rather than instantiating objects directly using new opreator.
C - These design patterns concern class and object composition. Concept of inheritance is
used to compose interfaces and define ways to compose objects to obtain new functionalities.
D - None of the above.
Ans B
13) Which of these interface must contain a unique element?

• A. Set

• B. List

• C. Array

• D. Collection

Ans A

14) Which of the following belongs to iterator pattern?


a) They delegate activities to other portions of the sub-system to
which they provide an interface
b) The details of such delegations depend on the sub-system in
question
c) The behavior follows the general outline of a broker pattern
interaction
d) None of the mentioned
Ans D

15) What is use of wildcards?


a) It is used in cases when type being operated upon is not known
b) It is used to make code more readable
c) It is used to access members of super class
d) It is used for type argument of generic method
Ans a
Complete syllabus
1) Polymorphism is extensively used in implementing:
a. Inheritance
b. Abstraction
c. Encapsulation
d. Dynamic Binding
Ans a

2) Which feature of the OOPS gives the concept of reusability?


A. Abstraction
B. Encapsulation
C. Inheritance
D. None of the above.
Ans. C

3) Which of these is an example of decomposition?


a. Breaking the problem of organising a cake sale into smaller parts, such as who
will bake the cakes and when to hold the cake sale
b. Taking the problem of baking a cake and thinking about how we can make it the
best cake possible.
c. Looking at what different kinds of cake can be made.
d. None of them
Ans. A

4) Swing is a part of JFC, where JFC stands for:


a. Java Foundation Classes
b. Java Free Class
c. Java Foundation Course
d. Java Free Course
Ans. A

5) A private member of a class is visible to:


a. Everywhere
b. In sub class
c. Members to same package
d. Only members of same class
Ans: d

6) What is the syntax of overloading operator + for class A?


a) A operator+(argument_list){}
b) A operator[+](argument_list){}
c) int +(argument_list){}
d) int [+](argument_list){}
Ans. A

7) What is an exception in C++ program?


a) A problem that arises during the execution of a program
b) A problem that arises during compilation
c) Also known as the syntax error
d) Also known as semantic error
Ans. A

8) In ………… stage of SDLC, training of the user staff, system documentation and
implementation is done.
A. system design
B. system implementation
C. system analysis
D. system development
Ans. B

9) Which is the container that doesn't contain title bar and MenuBars but it can have
other components like button, textfield etc?
a. Window
b. Frame
c. Panel
d. Container

ANS. C

10) Which of the following is not a kind of abstraction?


a) Data Abstraction
b) Iteration Abstraction
c) Specification Abstraction
d) Type Hierarchy
Ans c

11)
1.OOPs Ce51 sessional

Which of the following operators cannot be overloaded


(A) . (Member Access or Dot operator)
(B) ?: (Ternary or Conditional Operator )
(C) :: (Scope Resolution Operator)
(D) .* (Pointer-to-member Operator )
(E) All of the above

Answer: (E)

2.While overloading binary operators using member function, it requires ___ argument/s.

A. Zero
B. One
C. Two
D. Three

Answer : (B)

3.Scope resolution operator is used______ .


A. to resolve the scope of global variables only
B. to resolve the scope of functions of the classes only
C. to resolve scope of global variables as well as functions of the classes
D. None of these

Answer: Option C

4.Implicit return type of a class constructor is:


(A) not of class type itself
(B) class type itself
(C) a destructor of class type
(D) a destructor not of class type

Answer: (B)

5.Like constructors, can there be more than one destructors in a class? *

Yes

No

Answer : (No)
6.What is operator overloading in C++?

(a) Overriding the operator meaning by the user defined meaning for user defined data type

(b) Redefining the way operator works for user defined types

(c) Ability to provide the operators with some special meaning for user defined data type

(d) All of the mentioned

Answer (D)

7.What is the syntax of overloading operator + for class A?


a) A operator+(argument_list){}
b) A operator[+](argument_list){}
c) int +(argument_list){}
d) int [+](argument_list){}
View Answer

Answer: a

8.
Static data member is initialized by zero. No other initialization is allowed
State whether this statement is true or false.

True

False

Answer : False

9.A member function will accept two argument in case of binary operator overloading. State
whether this statement is true or false. *

True

False

Answer : True

10.Which of the following is correct about friend functions?

A. Friend functions use the dot operator to access members of a class using class objects
B. Friend functions can be private or public
C. Friend cannot access the members of the class directly
D. All of the above

Ans : D

11. What happens if a user forgets to define a constructor inside a class?


a) Error occurs
b) Segmentation fault
c) Objects are not created properly
d) Compiler provides a default constructor to avoid faults/errors
View Answer

Answer: d

12. What is syntax of defining a destructor of class A? *

Answer : ~A() { }

13.Operator overloading is also called …………….. polymorphism.


A) run time
B) initial time
C) compile time
D) completion time

Answer : C

14.When using __________ overloading through a member function, the left hand operand
must be an object of the relevant class.
A. Unary operators

B. Binary operators

C. Arithmetic operators

D. Function operator

Answer: Option B

15.Which of the following is true about constructors.


1) They cannot be virtual.
2) They cannot be private.
3) They are automatically called by new operator.
(A) All 1, 2, and 3
(B) Only 1 and 3
(C) Only 1 and 2
(D) Only 2 and 3

Answer: (B)

16.Constructors have _____ return type.


a)Void
b)Char
c)Int
d)No
Correct answer is option 'D'.

17. For Cat and Animal class, correct way of inheritance is


1 class Cat: public Animal
2 class Animal: public Cat
3 Both are correct way
4 None is correct way
Answer:
1

18. A private member of class is visible to:-


a) Only members of same class
b) Everywhere
c) Members to same package
d) In sub class
Answer:- a

19. Polymorphism is extensively used in implementing:


a) Encapsulation
b) Inheritence
c) Dynamic binding
d) Abstraction
Answer:- Inheritance

20. Dynamic binding is also known as


a) Late binding
b) Early binding
Answer:- Late binding

21. What is syntax of defining a destructor of a class


a) A(){}
b) A::A(){}
c) ~A(){};
d) ~A(){}
Answer:- c

22.which of the following are not tockens?


A Functions
B Operators
C Constants
D Keywords

Answer : Function

23.Which of the following is true?


(A) All objects of a class share all data members of class
(B) Objects of a class do not share non-static members. Every object has its own copy.
(C) Objects of a class do not share codes of non-static methods, they have their own copy
(D) None of the above

Answer: (B)

24.Which type of inheritance results in the diamond problem?


a) Single level
b) Hybrid
c) Hierarchical
d) Multilevel

Answer: b

25. While inheriting a class, if no access mode is specified, then which among the following is
true? (in C++)

(a) It gets inherited publicly by default

(b) It gets inherited protected by default

(c) It gets inherited privately by default

(d) It is not possible

Answer C

26.To perform the conversion from any other data type or class to a class type, a …………..
should be used in the destination class.
A) casting operator
B) constructor
C) not applicable
D) operator function

Answer B

27.What is the syntax of overloading operator + for class A?


a) A operator+(argument_list){}
b) A operator[+](argument_list){}
c) int +(argument_list){}
d) int [+](argument_list){}

Answer: a

28. If base class has constructor with arguments, then it is ________________ for the derived
class to have constructor and pass the arguments to base class constructor.

a. Optional
b. Mandatory
c. Compiler dependent
d. Error

ANSWER: Mandatory

29.When a base class is privately inherited by derived class public members of the base class
can only be accessed by the ……… of the derived class.
A) non-member functions
B) friend functions
C) member functions
D) class members

Answer : C) member functions

30. What will be the order of execution of base class constructors in the following method of
inheritance.class a: public b, public c {...};

A. b(); c(); a();


B. c(); b(); a();
C. a(); b(); c();
D. b(); a(); c();
View Answer

Ans : A
31. To perform the conversion from any other data type or class to a class type, a …………..
should be used in the destination class.
A) casting operator
B) constructor
C) not applicable
D) operator function

Answer: B) constructor

32.If a base class is inherited in protected access mode then which among the following is true?
a) Public and Protected members of base class becomes protected members of derived class
b) Only protected members become protected members of derived class
c) Private, Protected and Public all members of base, become private of derived class
d) Only private members of base, become private of derived class

Answer: a
17/12/2021, 12:01 Test 4

Test 4 Total points 5/15

PPS

0 of 0 points

Name

Rahul Arora

Roll No

19002030025

MCQ 5 of 15 points

Which of these is an example of decomposition? * 1/1

Looking at what different kinds of cake can be made.

Breaking the problem of organising a cake sale into smaller parts, such as who
will bake the cakes and when to hold the cake sale.

Taking the problem of baking a cake and thinking about how we can make it the best
cake possible.

https://docs.google.com/forms/d/e/1FAIpQLSdV3kqzOjOM5RIdmPeFf1f0dFpk5NjnpzMKmIYNADj6kfbeSQ/viewscore?viewscore=AE0zAgCQrB4oIJOs27Q… 1/7
17/12/2021, 12:01 Test 4

While decomposing a problem, what is considered? * 0/1

Level of detail of subproblems

Solution to subproblems can be combined to solve original problem

Dependency of subproblems

All of them

Correct answer

All of them

Which of the following is not a kind of abstraction? * 0/1

Iteration Abstraction

Type Hierarchy

Specification Abstraction

Data Abstraction

Correct answer

Specification Abstraction

Can we create object of Abstract class? * 0/1

No

Yes

Correct answer

No

https://docs.google.com/forms/d/e/1FAIpQLSdV3kqzOjOM5RIdmPeFf1f0dFpk5NjnpzMKmIYNADj6kfbeSQ/viewscore?viewscore=AE0zAgCQrB4oIJOs27Q… 2/7
17/12/2021, 12:01 Test 4

Predict the output of following program. #include<iostream> using 0/1


namespace std; class Base{public: virtual void show() = 0;}; class Derived
: public Base { }; int main(void){ Derived q; return 0;} *

No compiler Error

Compiler Error: there cannot be an empty derived class

Compiler Error: Derived is abstract

Correct answer

Compiler Error: Derived is abstract

Which is the container that doesn't contain title bar and MenuBars but it 0/1
can have other components like button, textfield etc? *

Window

Frame

Container

Panel

Correct answer

Panel

https://docs.google.com/forms/d/e/1FAIpQLSdV3kqzOjOM5RIdmPeFf1f0dFpk5NjnpzMKmIYNADj6kfbeSQ/viewscore?viewscore=AE0zAgCQrB4oIJOs27Q… 3/7
17/12/2021, 12:01 Test 4

The following specifies the advantages of _____. It is lightweight. It 1/1


supports pluggable look and feel. It follows MVC (Model View Controller)
architecture. *

Swing

Both a and b

None of the above

AWT

Swing is a part of JFC (Java Foundation Classes) that is used to create 0/1
GUI application. *

False

True

Correct answer

True

The ActionListener interface is not used for handling action events. * 1/1

False

True

https://docs.google.com/forms/d/e/1FAIpQLSdV3kqzOjOM5RIdmPeFf1f0dFpk5NjnpzMKmIYNADj6kfbeSQ/viewscore?viewscore=AE0zAgCQrB4oIJOs27Q… 4/7
17/12/2021, 12:01 Test 4

Which of these packages contains all the classes and methods required 1/1
for even handling in Java? *

java.event

java.applet

java.awt.event

java.awt

What is a listener in context to event handling? * 0/1

A listener is a method that is notified when an event occurs.

None of the mentioned

A listener is a object that is notified when an event occurs.

A listener is a variable that is notified when an event occurs.

Correct answer

A listener is a object that is notified when an event occurs.

Which of these events is generated when a button is pressed? * 0/1

KeyEvent

AdjustmentEvent

WindowEvent

ActionEvent

Correct answer

ActionEvent

https://docs.google.com/forms/d/e/1FAIpQLSdV3kqzOjOM5RIdmPeFf1f0dFpk5NjnpzMKmIYNADj6kfbeSQ/viewscore?viewscore=AE0zAgCQrB4oIJOs27Q… 5/7
17/12/2021, 12:01 Test 4

What is an event in delegation event model used by Java programming 0/1


language? *

An event is a class used for defining object, to create events.

An event is an object that describes any change by the user and system.

An event is an object that describes a state change in processing.

An event is an object that describes a state change in a source.

Correct answer

An event is an object that describes a state change in a source.

Give the abbreviation of AWT? * 0/1

Abstract Windowing Toolkit

Absolute Windowing Toolkit

None of the above

Applet Windowing Toolkit

Correct answer

Abstract Windowing Toolkit

https://docs.google.com/forms/d/e/1FAIpQLSdV3kqzOjOM5RIdmPeFf1f0dFpk5NjnpzMKmIYNADj6kfbeSQ/viewscore?viewscore=AE0zAgCQrB4oIJOs27Q… 6/7
17/12/2021, 12:01 Test 4

The Following steps are required to perform 1) Implement the Listener 1/1
interface and overrides its methods. 2) Register the component with the
Listener. *

None of the above

Event Handling

String Handling

Exception Handling

This form was created inside of JC Bose University of Science and Technology, YMCA Faridabad.

 Forms

https://docs.google.com/forms/d/e/1FAIpQLSdV3kqzOjOM5RIdmPeFf1f0dFpk5NjnpzMKmIYNADj6kfbeSQ/viewscore?viewscore=AE0zAgCQrB4oIJOs27Q… 7/7
23/12/2021, 12:03 Test 5

Test 5 Total points 3/15

0 of 0 points

Name *

Rahul Arora

Roll No. *

19002030070

OOPS 3 of 15 points

Which of the following pattern creates object without exposing the 0/1
creation logic to the client and refer to newly created object using a
common interface? *

Factory Pattern

Singleton Pattern

Transfer Object Pattern

Abstract Factory Pattern

Correct answer

Factory Pattern

https://docs.google.com/forms/d/e/1FAIpQLSfcik6459QQFrKre4OmaFEinm4Eut-hgc95YAcLJreERDVihQ/viewscore?viewscore=AE0zAgBMtkbihLFdsrcA6… 1/8
23/12/2021, 12:03 Test 5

Which of these is an correct way making a list that is upper bounded by 0/1
class Number? *

List(? extends Number)

List(? UpperBounds Number)

List<? extends Number>

List<extends ? Number>

Correct answer

List<? extends Number>

Which of these is wildcard symbol? * 1/1

&

What is Collection in Java? * 0/1

A group of interfaces

A group of objects

None of the mentioned

A group of classes

Correct answer

A group of objects

https://docs.google.com/forms/d/e/1FAIpQLSfcik6459QQFrKre4OmaFEinm4Eut-hgc95YAcLJreERDVihQ/viewscore?viewscore=AE0zAgBMtkbihLFdsrcA6… 2/8
23/12/2021, 12:03 Test 5

Which of the following is correct about Singleton design pattern? * 0/1

This type of design pattern comes under creational pattern.

All of the above.

Singleton class provides a way to access its only object which can be accessed
directly without need to instantiate the object of the class.

This pattern involves a single class which is responsible to create an object while
making sure that only single object gets created.

Correct answer

All of the above.

Which of the following describes the Structural pattern correctly? * 0/1

This type of pattern are specifically concerned with the presentation tier.

This type of patterns concern class and object composition. Concept of inheritance
is used to compose interfaces and define ways to compose objects to obtain new
functionalities.

This type of pattern are specifically concerned with communication between


objects.

This type of patterns provide a way to create objects while hiding the creation logic,
rather than instantiating objects directly using new opreator

Correct answer

This type of patterns concern class and object composition. Concept of inheritance
is used to compose interfaces and define ways to compose objects to obtain new
functionalities.

https://docs.google.com/forms/d/e/1FAIpQLSfcik6459QQFrKre4OmaFEinm4Eut-hgc95YAcLJreERDVihQ/viewscore?viewscore=AE0zAgBMtkbihLFdsrcA6… 3/8
23/12/2021, 12:03 Test 5

Which of these interface handle sequences? * 0/1

List

Comparator

Collection

Set

Correct answer

List

Which of these interface is not a part of Java's collection framework? * 0/1

SortedList

Set

SortedMap

List

Correct answer

SortedList

https://docs.google.com/forms/d/e/1FAIpQLSfcik6459QQFrKre4OmaFEinm4Eut-hgc95YAcLJreERDVihQ/viewscore?viewscore=AE0zAgBMtkbihLFdsrcA6… 4/8
23/12/2021, 12:03 Test 5

Which of these is Basic interface that all other interface inherits? * 0/1

List

Array

Set

Collection

Correct answer

Collection

Which of these methods can randomize all elements in a list? * 0/1

rand()

randomize()

ambigous()

shuffle()

Correct answer

shuffle()

https://docs.google.com/forms/d/e/1FAIpQLSfcik6459QQFrKre4OmaFEinm4Eut-hgc95YAcLJreERDVihQ/viewscore?viewscore=AE0zAgBMtkbihLFdsrcA6… 5/8
23/12/2021, 12:03 Test 5

MVC stand for: * 0/1

Modern-View-Controller.

Model-View-Constant.

Model-View-Controller.

None of these

Correct answer

Model-View-Controller.

Which of the following is correct about Creational design patterns? * 0/1

These design patterns provide a way to create objects while hiding the creation
logic, rather than instantiating objects directly using new opreator.

These design patterns concern class and object composition. Concept of


inheritance is used to compose interfaces and define ways to compose objects
to obtain new functionalities.

None of the above.

These design patterns are specifically concerned with communication between


objects.

Correct answer

These design patterns provide a way to create objects while hiding the creation logic,
rather than instantiating objects directly using new opreator.

https://docs.google.com/forms/d/e/1FAIpQLSfcik6459QQFrKre4OmaFEinm4Eut-hgc95YAcLJreERDVihQ/viewscore?viewscore=AE0zAgBMtkbihLFdsrcA6… 6/8
23/12/2021, 12:03 Test 5

Which of these interface must contain a unique element? * 1/1

Set

List

Array

Collection

Which of the following belongs to iterator pattern? * 0/1

The behavior follows the general outline of a broker pattern interaction

The details of such delegations depend on the sub-system in question

They delegate activities to other portions of the sub-system to which they provide an
interface

None of the mentioned

Correct answer

None of the mentioned

What is use of wildcards? * 1/1

It is used in cases when type being operated upon is not known

It is used for type argument of generic method

It is used to make code more readable

It is used to access members of super class

This form was created inside of JC Bose University of Science and Technology, YMCA Faridabad.

 Forms
https://docs.google.com/forms/d/e/1FAIpQLSfcik6459QQFrKre4OmaFEinm4Eut-hgc95YAcLJreERDVihQ/viewscore?viewscore=AE0zAgBMtkbihLFdsrcA6… 7/8
23/12/2021, 12:03 Test 5

https://docs.google.com/forms/d/e/1FAIpQLSfcik6459QQFrKre4OmaFEinm4Eut-hgc95YAcLJreERDVihQ/viewscore?viewscore=AE0zAgBMtkbihLFdsrcA6… 8/8

You might also like