SDA Lab Quiz 3 A & B

SDA Lab Quiz 3 A & B

University

10 Qs

quiz-placeholder

Similar activities

Quiz 5- OOAD (JAVA)

Quiz 5- OOAD (JAVA)

University

15 Qs

Programming Trivia

Programming Trivia

University

10 Qs

Projeto Orientado a Objetos

Projeto Orientado a Objetos

University

12 Qs

C++ public single inheritance

C++ public single inheritance

University

12 Qs

Object Oriented Programming Evaluation 4

Object Oriented Programming Evaluation 4

University

15 Qs

quiz 3

quiz 3

University

10 Qs

C# Cơ bản

C# Cơ bản

University

15 Qs

Java Lecture 2A

Java Lecture 2A

11th Grade - University

14 Qs

SDA Lab Quiz 3 A & B

SDA Lab Quiz 3 A & B

Assessment

Quiz

Computers

University

Medium

Created by

Muhammad Abdullah Nasim

Used 2+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the primary purpose of the Singleton pattern?

To ensure a class has only one instance and provide a global point of access to it

To inherit behavior from multiple classes

To instantiate multiple objects of the same type

To allow runtime object creation with different types

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Singleton s1 = Singleton.getInstance();

Singleton s2 = Singleton.getInstance();

System.out.println(s1 == s2);

true

false

Runtime Error

Compilation Error

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the Factory Method pattern mainly used for?

To enforce inheritance

To allow the creation of objects without specifying their concrete classes

To create a single global object

To serialize objects

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following best explains the advantage of Factory Method over direct object instantiation?

Reduces memory consumption

Increases tight coupling

Avoids constructors

Provides flexibility in object creation

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will be the output of the following code?

(Factory Method)

Woof

Meow

Runtime Error

None of these

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the main goal of the Composite design pattern?

To simplify condition checking

To treat individual and composite objects uniformly

To avoid using inheritance

To optimize recursion

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Folder
└── File

Which pattern does this represent?

Singleton

Builder

Composite

Factory Method

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?