12th Computer CH-6
12th Computer CH-6
Object-Oriented Concepts
------------------------------------------------------------------------------------------------
1. In which year the object-oriented programming concepts was started?
a) 1960 b) 1970 c) 1966 d) 1980
2. From the following which are the popular programing language that support
object-oriented programing?
a) C++, Java b) C#, VB.net c) ASP.net , PHP d) All of these
5. In which programing, the focus is on objects which containing both data and
functionality together?
a) Procedural b) Object-oriented c) Markup d) Makeup
8. In the "real" world, which of the following are the entities of which the world is
comprised?
a) object b) class c) Row d) Table
10. To identify the objects, we use the value of the attributes. These value is called as
…………
a) State b) class c) behavior d) object
1
14. ………………can be considered as a blueprint for various objects.
a) State b) class c) behavior d) object
17. A class is a concept used to embody all the common features of a particular set of
…………
a) State b) class c) behavior d) object
19. Which model can be used to create models of object-oriented software to help with
design of an application?
a)GML b)UML c) HML d) MUL
20. What is a visual modeling language defined and maintained by the OMG ?
a) UML b) XML c) GML d) HML
21. What specifies several diagrams for representing different aspects of a software
application?
a) UML b) XML c) GML d) HML
23. Which diagrams are the only diagrams which can be directly mapped with object-
oriented languages?
a) class diagrams b) Object diagram
c) Oriented diagram d) Table diagram
24. In class diagram, a class is represented with an icon using a rectangle split into
how many sections?
a) 1 b) 2 c) 3 d) 4
25. In class diagram, a class is represented with an icon using a rectangle in how
many sections?
a) name b) attributes c) behavior d) All of these
2
26. The three sections of a class diagram are :
1. Name of the class in the top section
2. Attributes or properties of the class in the middle section
3. Behavior or operations or methods of the class in the bottom section
4. All of these
36. …………………identify the type of data stored and its value at the start of the
program.
a) Data type b) initial value c) default value d) Both a and b
37. ………………is mandatory and all other items are optional in attribute declaration
notation.
a) class b) Attribute - Name c) state d) behavior
Class Name
Visibility attribute : data type=initial value
Visibility operation (argument list) : return type
3
39. In UML notation, an operation is declared using .......................syntax.
Ans. [<visibility>] <method name> (parameter list separated by comma) :
<return data type>
Person
name:string
city:string
gender:char='M'
birthdate:date
profession:string
SetBirthdate(d:int,m:int,y:int):date
chagneCity(newCity:string):string
display()
41. Which diagrams are independent of the programming language used for coding
an application?
a)UML diagram b) Class Diagram c) Object Diagram d) None
4
48. What is possible by wrapping data and methods into a single unit class and
declaring them as private?
a) Encapsulation b) Aggregation c) Messaging d) Polymorphism
49. Which members of the class are not available directly to outside world?
a)Private b) Protected c) Public d) Package
51. ………….keeps the data safe from unintended actions and inadvertent access by
outside objects.
a) Encapsulation b) Aggregation c) Messaging d) Polymorphism
52. What is a process of representing the essential features of the objects without
including implementation detail?
a) Encapsulation b) Data abstraction
c) Data Messaging d) Polymorphism
53. …………..is a concept that hides the complexity, it says what it does.
a) Encapsulation b) Data abstraction
c) Data Messaging d) Polymorphism
54. Which technique that relies on the separation of interfaces and implementation
which is not a new concept in programming?
a) Encapsulation b) Data abstraction
c) Data Messaging d) Polymorphism
55. A user defined function with necessary input data parameters also provides
………….
a) Encapsulation b) Data abstraction
c) Data Messaging d) Polymorphism
56. ……………. provides the skeleton or templates for our use. The system hides
certain details of how data is stored, created and maintained.
a) Encapsulation b) Data abstraction
c) Data Messaging d) Polymorphism
58. The basic difference between data encapsulation and data abstraction is :
Encapsulation protects data by making them inaccessible form outside and
abstraction enables to represent data in which the implementation details
are hidden (abstracted).
59. In ……….., we simply define a data type and a set of operation on it but the
implementation of operations is not seen.
a) ADT b) UML c) HML d) XML
5
60. In object-oriented terminology, a call to a method is referred to as a ……………..
a) Message b) class c) Attributes d) State
61. Which of the following means 'many forms' which may be different forms of single
method or operation?
a) Encapsulation b) Aggregation c) Messaging d) Polymorphism
62. Object-Oriented programing allows defining more than one method having same
name but different signatures (means number and type of parameters) in a single
class. This feature is known as ……….
a) Method overloading. b) Inheritance c) Data Messaging d) Method Overriding
64. The capability of using same names to mean different things in different contexts
is called what ?
a) Method overloading b) Inheritance
c) Data Messaging d) Method Overriding
65. When objects of one class are composed of objects of other class, it is called what
?
a) aggregation b) composition c) Encapsulation d) Both a or b
68. In………….., the class that forms part of the owner class can exist independently.
a) aggregation b) Composition c) Inheritance d) Polymorphism
69. Basic aggregation is represented using an …………symbol next to the whole class.
a) empty diamond b) Filled diamond c) empty circle d) filled circle
71. …………….. is a strong type of aggregation where the lifetime of the part class
depends on the existence of the owner class.
a) aggregation b) Composition c) Inheritance d) Polymorphism
72. If an object of aggregating class is ………….., its part class object also will get
deleted.
a) deleted b) updated c) appended d) modified
6
73. Inheritance is generally referred to as ………………….. relationship between two
classes.
a) is-a-kind-of b) is-a-part-of c) has-a d) like-a
74. ……….refers to the capability of defining a new class of objects that inherits the
characteristics of another existing class.
a) polymorphism b) Inheritance c) Aggregation d) Composition
78. ……………….is the another name for inheritance or "is a" relationship.
a) Generalization b) Polymorphism c) Aggregation d) Composition
79. ….....refers to a relationship between two classes where one class is a specialized
version of another.
a) Generalization b) Polymorphism c) Aggregation d) Composition
81. When a class is derived from two or more classes, it is known as ……………type of
inheritances.
a) multiple b) single c) multi level d) Both a and b
82. In……….feature, classes do not inherit from other classes, but are 'composed of'
other classes.
a) Aggregation b) composition c) polymorphism d)Inheritance
85. Which of the following is a concept that hides the complexity; it says what it does,
but not how it is done?
a) Abstraction b) Polymorphism c) Message d) Data
7
86. Which of the following can be used to create models of object-oriented software to
help with design of an application?
a) Unified Maseup language b) Unified markup language
c) Unified modeling language d) Unified morphing language
88. In Java, what keeps the data safe from unintended actions and inadvertent
access by outside objects?
a) Data-abstraction b) Polymorphism c) Encapsulation d) Aggregation
89. In class diagram, a class is represented with an icon using a rectangle is splitted
into how many sections?
a) 2 b) 3 c) 4 d) 6
Textual Exercise
1. In object-oriented methodology, the focus is on which of the following entities?
a) Data b)Functions c) Objects d) All of the above
8
8. With which of the following options polymorphism can not be achieved?
a) Data hiding b) operator overloading c) Method Overloading d) All of these
Full forms
1. UML is Unified Modeling Language
2. OMG is Object Management Group
3. ADT is Abstract Data Types