[go: up one dir, main page]

0% found this document useful (0 votes)
42 views9 pages

12th Computer CH-6

Uploaded by

Ilesh Shah
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)
42 views9 pages

12th Computer CH-6

Uploaded by

Ilesh Shah
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/ 9

Chapter – 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

3. The way of programing can be divided into ……………….categories.


a) structure / procedural b) object-oriented
c) Markup language d) both a and b

4. In which programing, the focus is on writing functions or procedures which


operate on data?
a) Procedural b) Object-oriented c) Markup d) Makeup

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

6. Which of the programing language enables the programmer to create modular,


reusable and expendable code?
a) Procedural b) Object-oriented c) Markup d) Makeup

7. Object-Oriented programing uses……….. as its fundamental building block.


a) object b) class c) Row d) Table

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

9. In object-oriented terminology, characteristics are known as …………


a) properties b) attributes c) entity d) both a or b

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

11. There is always a behavior associated with ……………….


a) State b) class c) behavior d) object

12. The behavior also known as ……………….


a) State b) class c) behavior d) method

13. Any real world objects can be described in terms of ……………………….


a) What it is called (identity) b) What it is (its state [value] )
c) What it does (its behavior) d) All of these

1
14. ………………can be considered as a blueprint for various objects.
a) State b) class c) behavior d) object

15. A ………….. is a template for multiple objects with similar features.


a) State b) class c) behavior d) object

16. A ……………….also describes a group of objects with similar attributes and


common behavior.
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

18. What presents a collection of classes, constraints and relationship among


classes?
a) Class diagram b) Object diagram c) Oriented diagram d) Table diagram

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

22. The purpose of the class diagram is to model the ………………view of an


application.
a) Static b) dynamic c) Random d) Linear

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

27. In UML notation, an attribute is declared using following syntax:


Ans. [<visibility>] <attribute name> [:<attribute data type> [=<initial value> ] ]

28. In an attribute declaration, the ………………….brackets are optional.


a) square [ ] b) circle ( ) c) angular < > d) Curly { }

29. In an attribute declarations, the value should be specified into ……….brackets.


a) square [ ] b) circle ( ) c) angular < > d) Curly { }

30. In an attribute declarations, the visibility can be classified into …………..


a) private b) protected, public c) package d) All of these

31. Which symbol is used for private visibility ?


a) # (Hash) b) - (Dash) c) + (Plus) d) ~ (Tilde)

32. Which symbol is used for protected visibility ?


a) # (Hash) b) - (Dash) c) + (Plus) d) ~ (Tilde)

33. Which symbol is used for public visibility ?


a) # (Hash) b) - (Dash) c) + (Plus) d) ~ (Tilde)

34. Which symbol is used for package visibility ?


a) # (Hash) b) - (Dash) c) + (Plus) d) ~ (Tilde)

35. ……………….generally refers to a variable.


a) class b) Attributes c) state d) behavior

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

38. The pictorial representation of a class using UML convention,

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>

40. Diagram of class 'Person'

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

42. ……………are presented using their state during execution of an application.


a) Objects b) class c) Attributes d) State

43. Objects are …………….


a) Dynamic b) Static c) Linear d) Random

44. In object-oriented programming, the problem of modification can be solved using


…………..
a) Encapsulation b) Aggregation c) Messaging d) Polymorphism

45. Diagram of objects p1 and p2 of class 'person'.

p1 : person p2 : person p1 : person


name=Urmi Patel name=Leena Soni name=Krishna
city=Ahmedabad city=Bikaner Enginner
gender='F' gender='F' city=Ahmedabad
birthdate=15-05- birthdate=20-11- gender='F'
1985 1985 birthdate=09-05-1985
profession=Teacher profession=Teacher profession=Teacher

46. How many core elements are there in computer program?


a) data b) element c) Attributes d) Both a and b

47. The mechanism of providing protection to data and methods of a program is


called What?
a) Encapsulation b) Aggregation c) Messaging d) Polymorphism

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

50. Encapsulation provides ………..hiding capability.


a) data b) information c) Table d) All of these

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

57. Which are the examples for data abstraction ?


a) ADT or structures (Struct) in C / C++ b) classes in C++/ JAVA
c) JavaScript d) Both a and b

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

63. In how many types of overloading is achieved by polymorphism?


a) function overloading b) operator overloading
c) Inheritance d) Both a and b

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

66. Aggregation represents ……………….type of relationship between classes.


a) 'has-a' b) 'a-part-of' c) a-kind-of d) Both a or b

67. Aggregation represents ……………relationship between two classes.


a) non-exclusive b) exclusive c) Strong d) Simple

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

70. Composition represents …………….. relationship between two classes.


a) non-exclusive b) exclusive c) Strong d) Simple

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

75. In Inheritance ( Object-Oriented ) terminology, new class is called …………………


a) sub class b) child class c) derived class d) All of these

76. In Inheritance (Object-oriented) terminology, the existing class is called …………..


a) super class b) parents class c) base class d) All of these

77. In a class diagram, inheritance is represented using an …………….pointing to


superclass.
a) arrow b) diamond c) circle d) dash

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

80. In Inheritance, common attributes and methods are defined in ……………..class in


inheritance.
a) sub b) Super c) sub, super d) public

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

83. In class diagram, composition is represented using, which of the following


symbols?
a) Empty diamond b) Filled diamond c) Empty triangle d) Filled triangle

84. Which of the following is not a visibility symbol?


a) # (hash) b) * (star) c) ~ (tilde) d) d (dash)

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

87. What is the full form of JVM?


a) Java Varity Machine b) Java Vertical Machine
c) Java Virtual Machine d) Java Visual Machine

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

90. Aggregation represents which type of relationship between two classes?


a) non-exclusive b) exclusive c) same d) None of the above

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

2. Which of the following best suits to Java?


a) A procedural programing language
b) An object-oriented programing language
c) A Query language d) All of the above

3. Which of the following is used to distinguish objects from each other?


a) attribute b) state c) Behavior d) All of the above

4. Which of the following is used to define common features of similar objects?


a) class b) object c) method d) All of the above

5. Which of the following is not a visibility symbol?


a) ~ (b) * c) # d) –

6. Which of the following is enabled by data abstraction?


a) data protection
b) To hide implementation details of method manipulating the data
c) data sharing d) All of these

7. Which of the following is provided using encapsulation?


a) Data protection b) Data sharing
c) Separation of data and methods d) All of these

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

9. An aggregation model refers to which of the following relationship?


a) 'is-a' relationship b) 'a-part-of' c) ‘is-like’ d) All of these

10. An inheritance model refers to which of the following relationship?


a) 'is-a' relationship b) 'has-s' relationship
c) ‘a-part-of’ relationship d) All of these

11. In class diagram, composition is represented using which of the following


symbols?
a) empty diamond b) Filled diamond
c) Empty triangle symbol d) all of these

Full forms
1. UML is Unified Modeling Language
2. OMG is Object Management Group
3. ADT is Abstract Data Types

You might also like