ITELEC2c Quizzes prelims-finals 4ITD

Ace your homework & exams now with Quizwiz!

c

As an analogy, a design pattern is to program as __________ A - Metal is to car B - Park is to tree C - Blueprint is to building D - Mountain Dew is to soda

c

Ensure a class has only one instance, and provide a global access point to it. A - Single Class Factory B - Proxy C - Singleton D - Flyweight

d

Which of these interface does not inherit the Collection interface? a. List b. Set c. SortedMap d. SortedList

b

Which of these interface handle sequences? a. Set b. List c. Maps d. Collection

a

Which of these interface must contain a unique element? a. Set b. List c. Array d. Collection

d

Which of these is basic interface that all other interface inherits in the JCF? a. Set b. Array c. List d. Collection

d

Provide an unified interface to a set of interfaces in a subsystem.It define a higher level interface that makes the subsystem easier to use. A - Builder Pattern B - Adapter Pattern C - Prototype Pattern D - Façade Pattern

True

True or False There are no direct implementation of the Collection<E> interface?

d

Which of the following is true about design patterns? A - Design patterns represent the best practices used by experienced object-oriented software developers. B - Design patterns are solutions to general problems that software developers faced during development. C - Design patterns are obtained by trial and error by numerous software developers over quite a substantial period of time. D - All of the above.

c

Which of the following matters least in the use of a design pattern? A - The pattern's name B - The problem the pattern solves C - The source code that implements the pattern D - The consequences of using the pattern

a

Which of the following pattern builds a complex object using simple objects and using a step by step approach? A - Builder Pattern B - Bridge Pattern C - Adapter Pattern D - Filter Pattern

a

In MVC pattern, View represents the visualization of the data that model contains. A - True B - False

b

What type of List is used with synchronized access? a. ArrayList b. Vector c. LinkedList d. List

d

What type of collection would we use if we wanted no duplicates? a. Lists b. Maps c. Queues d. Sets

c

A design pattern is ________________. A - an algorithm used in object-oriented programming B - a data structure used in object-oriented programming C - a solution to a common problem in object-oriented programming D - a blueprint for a particular kind of class

d

Big portion of clients are remotely invoking methods in your system, the surface area exposed to clients includes fine-grained methods, which of course causes network overhead. Which pattern would improve your system performance in this case? A - Builder Pattern B - Adapter Pattern C - Prototype Pattern D - Façade Pattern

a

Inheritance in object-oriented system is used to _____________. A - create new classes from existing classes B - add new operations to existing operations C - add new attributes to existing attributers D - add new states to existing states

True

True or False The facade pattern is used to in coupling between different subsystems.

a

You need to store elements in a collection that guarantees that no duplicates are stored and all elements can be accessed in natural order. Which interface provides that capability? a. Map b. List c. Collection d. Set

d

By encapsulation in object-oriented modelling we mean _______________. A - encapuslating data and programs B - hiding attributes of an object from users C - hiding operations on object from users D - hiding implementation details of methods from users of objects

a

It defines an interface for creating an object, but let the subclasses decide which class to instantiate. It let the instantiation differ to subclasses. A - Factory Method B - Abstract Factory C - Builder D - Prototype

a

Process of creating exact copy of the existing object is called _________. A - cloning B - overloading C - overriding D - coping

True

True or False In the Facade pattern clients are not allowed to use subsystem classes directly.

True

True or False In the facade pattern, clients only interact with a subsystems facade. They never interact with the subsystem directly.

True

True or False Integer.valueOf is an example of Factory pattern.

True

True or False The facade object only forwards a client request to the subsystem, it does not answer the request itself.

a

What is Gang of Four (GOF)? A - Four authors of Book 'Design Patterns - Elements of Reusable Object-Oriented Software' are known as Gang of Four (GOF). B - Gang of Four (GOF) is a name of a book on Design Patterns. C - Gang of Four (GOF) is a Design Pattern. D - None of the above.

a

What is a Collection in Java? a. set of classes b. set of interfaces c. set of objects d. set of collections

c

What will be the output of the program? TreeSet map = new TreeSet(); map.add("one"); map.add("two"); map.add("three"); map.add("four"); map.add("one"); Iterator it = map.iterator(); while (it.hasNext() ) { System.out.print( it.next() + " " ); } a. one two three four b. four three two one c. four one three two d. one two three four one

Polymorphism

When child class object pass into parent class reference it is called ________.

d

Which collection class allows you to grow or shrink its size and provides indexed access to its elements, but whose methods are not synchronized? a. HashSet b. LinkedHashSet c. List d. ArrayList

c

Which of the following describes the Facade pattern correctly? A - This pattern allows a user to add new functionality to an existing object without altering its structure. B - This pattern is used where we need to treat a group of objects in similar way as a single object. C - This pattern hides the complexities of the system and provides an interface to the client using which the client can access the system. D - This pattern is primarily used to reduce the number of objects created and to decrease memory footprint and increase performance.

a

Which of the following describes the Factory pattern correctly? A - This pattern creates object without exposing the creation logic to the client and refer to newly created object using a common interface. B - In this pattern an interface is responsible for creating a factory of related objects without explicitly specifying their classes. C - This pattern involves a single class which is responsible to create an object while making sure that only single object gets created. D - This pattern is used when we want to pass data with multiple attributes in one shot from client to server.

b

Which of the following describes the Prototype pattern correctly? A - This pattern builds a complex object using simple objects and using a step by step approach. B - This pattern refers to creating duplicate object while keeping performance in mind. C - This pattern works as a bridge between two incompatible interfaces. D - This pattern is used when we need to decouple an abstraction from its implementation so that the two can vary independently.

b

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 operator. 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.

d

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.

a

Which of the following is correct list of classifications of design patterns. A - Creational, Structural and Behavioral patterns. B - Executional, Structural and Behavioral patterns. C - Creational, Executional and Behavioral patterns. D - None of the above.

c

Which of the following pattern is used to decouple presentation tier and business tier? A - Visitor Pattern B - MVC Pattern C - Business Delegate Pattern D - Composite Entity Pattern

b

Which of the following pattern works as a bridge between two incompatible interfaces? A - Builder Pattern B - Adapter Pattern C - Prototype Pattern D - Filter Pattern

a

Which of the following programming languages is best suited to design patterns? A - Java B - C C - Cobol D - HTML E - None of these

b

Which of the following techniques is a direct benefit of design patterns? A - Faster analysis B - Faster coding C - Ease of testing solutions D - Modifying the program is easier

d

Which of these interface declares core method that all collections will have? a. set b. EventListner c. Comparator d. Collection

a

Which of these methods deletes all the elements from invoking collection? a. clear() b. reset() c. delete() d. refresh()

b

Which of these packages contain all the collection classes? a. java.lang b. java.util c. java.net d. java.awt

a

Which statement is true for the class ArrayList? a. The elements in the collection are ordered. b. The collection is guaranteed to be immutable. c. The elements in the collection are guaranteed to be unique. d. The elements in the collection are accessed using a unique key.


Related study sets

Unit 3: Iran & Islamic Revolution Questions & Definitions

View Set

ASTRO CH. 6 Reading / Concept Quiz

View Set

Managerial Accounting | Chapter 2

View Set

Introduction to Pharmacology - Chapter 1 - Learning Objectives

View Set

Multiples of 10, 100, and 1,000!

View Set

post transcriptional regulation of gene expression

View Set