oop

Description

Quiz on oop, created by Hello World on 20/01/2017.
Hello World
Quiz by Hello World, updated more than 1 year ago
Hello World
Created by Hello World almost 8 years ago
401
5

Resource summary

Question 1

Question
1. C-style languages are
Answer
  • a) C, C#
  • b) C, C++
  • c) C, C#, C++
  • d) C, C#, C++, Java
  • e) C#, C++

Question 2

Question
2. Choose the incorrect statement for C style languages.
Answer
  • a) semicolons are not used to denote the end of a statement
  • b) curly brackets are used to group statements
  • c) variables are assigned using an equals sign, but compared using two consecutive equals sign
  • d) square brackets are used with arrays
  • e) a, b, c, d

Question 3

Question
3. Which aspects does variable have?
Answer
  • a) type, size and memory address
  • b) memory address, type and value
  • c) type and value
  • d) value, size and memory address

Question 4

Question
4. What declaration of variables is the correct?
Answer
  • a) char c;i;
  • b) int b;c;
  • c) char c, char s;
  • d) double a, b;

Question 5

Question
5. Declaration of variable is not a statement of C# language, but ends with semicolon.
Answer
  • True
  • False

Question 6

Question
6. Declaration of variable is a statement of C# language.
Answer
  • True
  • False

Question 7

Question
7. Which rule is correct when naming variables?
Answer
  • a) the first character must be letters, underscore only
  • b) an identifier can consist of letters, number and reserved words
  • c) reserved words can be used as variable names
  • d) the first character must be only letter

Question 8

Question
8. C# is case sensitive language.
Answer
  • a) yes
  • b) no
  • c) it depends on data type

Question 9

Question
9. Choose the correct statement with initializing.
Answer
  • a) string c="0";
  • b) int i="0";
  • c) char c="0";
  • d) int i='0';

Question 10

Question
10. What method in C# is Console output?
Answer
  • a) ReadLine
  • b) WriteLine

Question 11

Question
11. What method in C# is Console input?
Answer
  • a) ReadLine
  • b) WriteLine

Question 12

Question
12. The result in Console application of this code will be? int a=8, b=2, c=0; c=a+b; Console.WriteLine(“{0}+{1}={2}”,b,a,c);
Answer
  • a) 2+8=10
  • b) 8+2=10
  • c) 10=2+8
  • d) 10=8+2

Question 13

Question
13. Choose the incorrect assignment? int i,j;
Answer
  • a) i=j=1;
  • b) i=10,j=10;
  • c) i=(j=10);
  • d) a, b, c

Question 14

Question
14. What will be the result? int i=5; int j=1; int x=(j--)+(--i);
Answer
  • a) x=6;
  • b) x=5;
  • c) x=7;
  • d) x=8;

Question 15

Question
15. What will be the result? int x=10,i=0,j=2; x+=(i-j);
Answer
  • a) 14
  • b) 10
  • c) 12
  • d) 8

Question 16

Question
16. The “for” statement can be an infinite loop.
Answer
  • True
  • False

Question 17

Question
17. Choose the incorrect For statement?
Answer
  • a) for(;;){}
  • b) for( int x = 0, x<= 100; x++){}
  • c) int x = 0; for(; x<= 100; x++){}
  • d) a,b,c

Question 18

Question
18. The statements bodies of the “for” and “while” operators might never be executed.
Answer
  • True
  • False

Question 19

Question
19. The statements bodies of the “for” and “while” operators must be executed at least once.
Answer
  • True
  • False

Question 20

Question
20. The statements bodies of the “for” and “foreach” operators might never be executed.
Answer
  • True
  • False

Question 21

Question
21. The statements bodies of the “for” and “foreach” operators must be executed at least once.
Answer
  • True
  • False

Question 22

Question
22. In what statement the Statements body is always executed at least once?
Answer
  • a) for, do while, while
  • b) do while
  • c) foreach, while
  • d) do while, for

Question 23

Question
23. C# classes contain:
Answer
  • a) properties and functions
  • b) data members(field, variables), properties and methods
  • c) method, functions and constructors
  • d) variables and methods

Question 24

Question
24. The properties in C# classes are…
Answer
  • a) procedures and functions
  • b) constructors
  • c) data members(variables)
  • d) members with get and set

Question 25

Question
25. C# procedure specifies with …
Answer
  • a) this keyword
  • b) void keyword
  • c) return data type
  • d) static keyword

Question 26

Question
26. An object is …
Answer
  • a) a property of the class
  • b) an instance of the class
  • c) a method of the class
  • d) a data member of the class

Question 27

Question
27. The classes are like new data types.
Answer
  • True
  • False

Question 28

Question
28. Access modifiers are ...
Answer
  • a) void and return data types
  • b) public and private
  • c) data types
  • d) this and static keywords

Question 29

Question
29. A public method with the same name as the class with no return type is ...
Answer
  • a) constructor
  • b) function
  • c) procedure
  • d) property

Question 30

Question
30. Procedures and constructors can’t be passed any arguments.
Answer
  • True
  • False

Question 31

Question
31. Functions can’t be passed any arguments.
Answer
  • True
  • False

Question 32

Question
32. Functions can be passed any arguments.
Answer
  • True
  • False

Question 33

Question
33. Procedures can’t be passed any arguments.
Answer
  • True
  • False

Question 34

Question
34. Procedures can be passed any arguments.
Answer
  • True
  • False

Question 35

Question
35. Methods can be passed any arguments.
Answer
  • True
  • False

Question 36

Question
36. Methods can’t be passed any arguments.
Answer
  • True
  • False

Question 37

Question
37. The default constructor is a method with …
Answer
  • a) any arguments
  • b) no arguments

Question 38

Question
38. In the static method must be absent “this” reference, as such method doesn’t work with any object.
Answer
  • True
  • False

Question 39

Question
39. In the static method allowed immediate call only other instance methods.
Answer
  • True
  • False

Question 40

Question
40. The “this” keyword can be used for...
Answer
  • a) methods
  • b) functions and procedures
  • c) constructors
  • d) a, b, c

Question 41

Question
41. Choose the correct declaration of array.
Answer
  • a) int[] a = int[10];
  • b) int[] c = new int[10];
  • c) int[] a = new [10];
  • d) a, b, c

Question 42

Question
42. Choose the correct declaration of jugged array.
Answer
  • a) int [][] j = new int[];
  • b) int [][] j = new int[][5];
  • c) int [][] j = int [5][5];
  • d) int [][] j = new int[5][];

Question 43

Question
43. Choose the correct declaration and initialization of array.
Answer
  • a) int[] a = new int[5]{1,5,8,4,5};
  • b) int[] a = {1,5,8,4,5};
  • c) a,b
  • d) there is no correct answer

Question 44

Question
44. Choose the correct declaration of two-dimensional array.
Answer
  • a) int[][] a = new int [2][5];
  • b) int [] a = new int [2][5];
  • c) int [,] a = new int[2,5];
  • d) int[,] a = new int[2][5];

Question 45

Question
45. The last unit (element) index of array is…
Answer
  • a) 0
  • b) 10
  • c) length
  • d) length-1

Question 46

Question
46. How many elements does the next array include? Int[] a=new int[77];
Answer
  • a) 76
  • b) 77
  • c) 78

Question 47

Question
47. How many elements does the next array include? Int[] a=new int[100];
Answer
  • a) 99
  • b) 100
  • c) 101

Question 48

Question
48. C# function specifies with …
Answer
  • a) this keyword
  • b) void keyword
  • c) return data type
  • d) static keyword

Question 49

Question
49. The statements body of the “do while” operator might never be executed.
Answer
  • True
  • False

Question 50

Question
50. The statements body of the “do while” operator must be executed at least once.
Answer
  • True
  • False

Question 51

Question
51. Choose the correct assignment? int i,j;
Answer
  • a) i,j=8;
  • b) i=8,j=8;
  • c) i=(j=8);
  • d) a,b,c;

Question 52

Question
52. Constructors can’t be passed any arguments.
Answer
  • True
  • False

Question 53

Question
53. Constructors can be passed any arguments.
Answer
  • True
  • False

Question 54

Question
54. Default constructors can’t be passed any arguments.
Answer
  • True
  • False

Question 55

Question
55. Default constructors can be passed any arguments.
Answer
  • True
  • False

Question 56

Question
56. How many elements does the next array include? int[] a=new int[99];
Answer
  • a) 99
  • b) 100
  • c) 101

Question 57

Question
57. Choose the core principles of OOP
Answer
  • a) Encapsulation and Inheritance
  • b) Encapsulation, Inheritance and Polymorphism
  • c) encapsulation and polymorphism
  • d) encapsulation, inheritance, polymorphism, aggregation and composition

Question 58

Question
58. Hiding an object’s internal implementation detail is…
Answer
  • a) encapsulation
  • b) inheritance
  • c) polymorphism
  • d) composition

Question 59

Question
59. Which concept promotes code reuse?
Answer
  • a) encapsulation
  • b) inheritance
  • c) polymorphism
  • d) composition

Question 60

Question
60. Which statement shows Encapsulation concept?
Answer
  • a) string s = “Hello World!”;
  • b) int a,b=0;
  • c) b++;
  • d) string s = “hello”, bool i=s.Equals(“!”);

Question 61

Question
61. Closely related to the notion of encapsulating programming logic is the idea of…
Answer
  • a) overriding
  • b) data protection
  • c) overloading
  • d) realization

Question 62

Question
62. Which access modificator (s) related to the data protection?
Answer
  • a) public
  • b) protected
  • c) private
  • d) private and protected

Question 63

Question
63. Members of a class that represent an object’s state should not be marked as
Answer
  • a) public
  • b) private
  • c) protected

Question 64

Question
64. Choose traditional technique to encapsulate class’s data.
Answer
  • a) Define default constructor
  • b) Define your own constructor
  • c) Define a pair of public accessor(get) and mutator(set) methods
  • d) Mark the data of class as public

Question 65

Question
65. Choose a technique to encapsulate class’s data
Answer
  • a) Define fields of class
  • b) Define your own constructor
  • c) Define a public properties
  • d) Define a private properties

Question 66

Question
66. The “Black boxing programming” term is related to
Answer
  • a) inheritance
  • c) objects
  • b) encapsulation
  • d) polymorphism

Question 67

Question
67. A “get” method …
Answer
  • a) returns the current value of state data
  • b) returns the default value of state data
  • c) allows to change the current value of state data
  • d) allows to change the methods of class

Question 68

Question
68. A “set” method …
Answer
  • a) returns the current value of state data
  • b) returns the default value of state data
  • c) allows to change the current value of state data
  • d) allows to change the methods of class

Question 69

Question
69. Is it possible to perform any internal logic necessary before making the value assignment in properties of class?
Answer
  • a) yes
  • b) no

Question 70

Question
70. Which keyword is related to the "get" block of property?
Answer
  • a) value
  • b) return
  • c) this
  • d) public

Question 71

Question
71. Which keyword is related to the "set" block of property?
Answer
  • a) value
  • b) return
  • c) this
  • d) public

Question 72

Question
72. Inheritance of OOP facilities ...
Answer
  • a) data protection
  • b) data hiding
  • c) code reuse

Question 73

Question
73. Classical inheritance is …
Answer
  • a) a model of “is-a” relationship
  • b) a model of a “has-a” relationship

Question 74

Question
74. The parent class is
Answer
  • a) a child class
  • b) a derived class
  • c) a base class

Question 75

Question
75. The extending classes are formally termed...
Answer
  • a) child classes
  • b) parent classes
  • c) base classes

Question 76

Question
76. What role of parent class?
Answer
  • a) define all the common data and members for the classes that extend it
  • b) define all the common methods for the classes that extend it
  • c) define all the common data for the classes that extend it
  • d) define all the common properties and functions for the classes that extend it

Question 77

Question
77. A child class inherits the constructor of a parent class.
Answer
  • True
  • False

Question 78

Question
78. Which members can never be accessed from parent class?
Answer
  • a) public members
  • b) private members
  • c) protected members
  • d) private and protected

Question 79

Question
79. (?)Is it possible to build multiple inheritance for classes in C# language ?
Answer
  • a) yes
  • b) no

Question 80

Question
80. Which classes cannot have its child classes?
Answer
  • a) public classes
  • b) sealed classes
  • c) private classes
  • d) derived classes

Question 81

Question
81. Which members of parent class cannot be accessed to other classes, but can be accessed to its child classes?
Answer
  • a) all members
  • b) public members
  • c) private members
  • d) protected members

Question 82

Question
82. Another use of the "this" keyword is to design a class using a technique termed…
Answer
  • a) constructor definition
  • b) constructor creation
  • c) constructor chaining
  • d) constructor using

Question 83

Question
83. The "base" keyword refers to …
Answer
  • a) the parent class
  • b) the child class
  • c) derived class

Question 84

Question
84. The process termed "method overriding" is …
Answer
  • a) a way for base classes to define as own version of a method defined by its parent class
  • b) a way for child classes to define its own version of a method defined by its derived class
  • c) a way for parent classes to define its own version of a method defined by its child class
  • d) a way for child classes to define its own version of a method defined by its parent class

Question 85

Question
85. A virtual method of a parent class must be overridden for by each derived classes.
Answer
  • True
  • False

Question 86

Question
86. A virtual method of a parent class must not be overridden for by each derived classes.
Answer
  • True
  • False

Question 87

Question
87. A virtual method of a parent class has its own implementation body block.
Answer
  • True
  • False

Question 88

Question
88. A virtual method of a parent class has not its own implementation body block.
Answer
  • True
  • False

Question 89

Question
89. An abstract method of a parent class has its own implementation body block.
Answer
  • True
  • False

Question 90

Question
90. An abstract method of a parent class has not its own implementation body block.
Answer
  • True
  • False

Question 91

Question
91. An abstract method of a parent class must be overridden for by each child class.
Answer
  • True
  • False

Question 92

Question
92. An abstract method of a parent class must not be overridden for by each child class.
Answer
  • True
  • False

Question 93

Question
93. Which feature is not related to an abstract class?
Answer
  • a) it is impossible to create an instance(object) of an abstract class
  • b) all abstract methods and properties of a basic class have not to be realized in a derived class
  • c) the abstract class may contain both abstract and common methods/properties
  • d) all abstract methods and properties of a basic class have to be realized in a derived class

Question 94

Question
94. An interface is defined using...
Answer
  • a) the capital letter “I” in the name
  • b) the interface keyword
  • c) the abstract keyword
  • d) the virtual keyword

Question 95

Question
95. An interface defines …
Answer
  • a) the method signature
  • b) the virtual methods
  • c) the common methods
  • d) the abstract methods

Question 96

Question
96. Classes that implement an interface are contractually required to implement the interface signature definition and can’t alter it.
Answer
  • True
  • False

Question 97

Question
97. A class can support as many interfaces as necessary.
Answer
  • True
  • False

Question 98

Question
98. A class can support only one interface.
Answer
  • True
  • False

Question 99

Question
99. A class cannot support as many interfaces as necessary.
Answer
  • True
  • False

Question 100

Question
100. "Has-a" relationship is ...
Answer
  • a) traditional form of code reuse in the world of OPP
  • b) another form of code reuse in the world of OOP
  • c) traditional form of data protection in the world of OOP
  • d) another form of data protection in the world of OOP

Question 101

Question
101. "Has-a" relationship commonly includes ...
Answer
  • a) encapsulation and composition terms
  • b) aggregation and polymorphism terms
  • c) polymorphism and composition terms
  • d) aggregation and composition terms

Question 102

Question
102. "Has-a" relationship must establish parent/child relationships.
Answer
  • True
  • False

Question 103

Question
103. The "has-a" relationship allows one class to define a member variable of another class and expose its functionality (if required) to the object user indirectly.
Answer
  • True
  • False

Question 104

Question
104. The .NET Framework allows to work with graphics using the ...
Answer
  • a) System.Drawing namespace
  • b) System.IO namespace
  • c) System.Windows.Form namespace
  • d) System.Data namespace

Question 105

Question
105. Which class is used to draw lines, curves and shapes?
Answer
  • a) The Brush class
  • b) The Pencil class
  • d) The Region class
  • c) The Pen class

Question 106

Question
106. Which class is used to fill shapes?
Answer
  • a) The Brush class
  • b) The Pencil class
  • c) The Pen class
  • d) The Region class

Question 107

Question
107. Choose the correct code to specify the location of control?
Answer
  • a) button1.Size = new Size(10,10);
  • b) button1.Location = Point(10,10);
  • c) button1.Location(10,10);
  • d) button1.Location = new Point(10,10);

Question 108

Question
108. Choose the correct code to specify the size of control?
Answer
  • a) button1.Size = new Size(10,10);
  • b) button1.Location = Point(10,10);
  • c) button1.Location(10,10);
  • d) button1.Location = new Point(10,10);

Question 109

Question
109. Which properties of controls can be used to specify its location?
Answer
  • a) Size
  • b) Left, Right, Top, Bottom
  • c) ForeColor and BlackColor
  • d) Left, Right

Question 110

Question
110. Drawing begins with the ...
Answer
  • a) System.Drawing.Pen class
  • b) System.Drawing.Graphics class
  • c) System.Drawing.Brush class
  • d) System.Drawing.Image class

Question 111

Question
111. To use Draw methods of the graphic object, we must provide an instance of the Pen class.
Answer
  • True
  • False

Question 112

Question
112. To use Draw methods of the graphic object, we must provide an instance of the Brush class.
Answer
  • True
  • False

Question 113

Question
113. Graphics.DrawLines, Graphisc.DrawPolygon, and Graphics.DrawRectangles accept arrays as parameters to allow us to create more complex shapes.
Answer
  • True
  • False

Question 114

Question
114. To use Fill methods of the graphic object, we must provide an instance of the Brush class.
Answer
  • True
  • False

Question 115

Question
115. To use Fill methods of the graphic object, we must provide an instance of the Pen class.
Answer
  • True
  • False

Question 116

Question
116. What method returns a String array containing the substrings in this instance that are delimited by elements of a specified char array or string array? Answer: Split!
Answer
  • True
  • False

Question 117

Question
117. An enumerated type is declared using the … keyword. Answer: Enum
Answer
  • True
  • False

Question 118

Question
118. By default, the first enumerator has the value…
Answer
  • 0
  • 1
  • 2
  • 9

Question 119

Question
119. C# structures are created with … keyword.
Answer
  • struct
  • new
  • is

Question 120

Question
120. Virtual methods are defined in …
Answer
  • Parent class
  • Child class

Question 121

Question
121. What big advantage of using interfaces ?
Answer
  • Is that class can implement multiple interfaces;
  • Is that class can not implement multiple interfaces;

Question 122

Question
122. Is it enough to create polymorphic methods using the "virtual" and "override" keywords?
Answer
  • True
  • False

Question 123

Question
123. Inheritance allows to build …
Answer
  • a dependency between two or more class
  • a dependency only between two

Question 124

Question
174. Which of the following returns true if at least one expression is true?
Answer
  • and
  • or

Question 125

Question
175. Which of the following returns true if two expressions are true?
Answer
  • and
  • not

Question 126

Question
176. The keywords of the Switch statement are ...
Answer
  • switch, case default, goto, return, throw
  • for, case default, goto, return, throw
  • begin,end,swap

Question 127

Question
125. The int type is …
Answer
  • value,predefined
  • reference,predefined
  • value,user-defined
  • reference,user-defined

Question 128

Question
126. The bool type is …
Answer
  • value,predefined
  • reference,predefined
  • value,user-defined
  • reference,user-defined

Question 129

Question
127. The char type is …
Answer
  • value,predefined
  • reference,predefined
  • value,user-defined
  • reference,user-defined

Question 130

Question
128. The long type is …
Answer
  • value,predefined
  • reference,predefined
  • value,user-defined
  • reference,user-defined

Question 131

Question
129. The float type is …
Answer
  • value,predefined
  • reference,predefined
  • value,user-defined
  • reference,user-defined

Question 132

Question
130. The double type is …
Answer
  • value,predefined
  • reference,predefined
  • value,user-defined
  • reference,user-defined

Question 133

Question
131. The class type is …
Answer
  • reference, user-defined
  • value,predefined
  • value,user-defined
  • reference,predefined

Question 134

Question
132. The interface type is …
Answer
  • reference, user-defined
  • value,user-defined
  • value,predefined
  • reference,predefined

Question 135

Question
133. The object type is…
Answer
  • value,predefined
  • value,user-defined
  • reference,user-defined
  • reference,predefined

Question 136

Question
134. The string type is …
Answer
  • reference,predefined
  • value,predefined
  • value,user-defined
  • reference,user-defined

Question 137

Question
135. The struct type is …
Answer
  • value, user-defined
  • reference,user-defined
  • value,predefined
  • reference,predefined

Question 138

Question
136. The enum type is …
Answer
  • value, user-defined
  • reference,user-defined
  • reference,predefined
  • value,predefined
Show full summary Hide full summary

Similar

Object Oriented Programming Concepts
Cmagapu
Concepts of Objects and Classes
BK Modding
Introduction to Java
BK Modding
Paradigma de Programación Orientado a Objetos
JULIAN CAMILO RIVEROS FONSECA
1.2.4 OOP
Louis N
constructor
balakvm.it
Classes
needajob517
OOP Definitions
Matt Dumbrill
Object Oriented Programming Concepts
agni bharathi
Object Oriented Programming Concepts
Rian McCollom