oop

Descrição

Quiz sobre oop, criado por Hello World em 20-01-2017.
Hello World
Quiz por Hello World, atualizado more than 1 year ago
Hello World
Criado por Hello World mais de 7 anos atrás
392
5

Resumo de Recurso

Questão 1

Questão
1. C-style languages are
Responda
  • a) C, C#
  • b) C, C++
  • c) C, C#, C++
  • d) C, C#, C++, Java
  • e) C#, C++

Questão 2

Questão
2. Choose the incorrect statement for C style languages.
Responda
  • 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

Questão 3

Questão
3. Which aspects does variable have?
Responda
  • a) type, size and memory address
  • b) memory address, type and value
  • c) type and value
  • d) value, size and memory address

Questão 4

Questão
4. What declaration of variables is the correct?
Responda
  • a) char c;i;
  • b) int b;c;
  • c) char c, char s;
  • d) double a, b;

Questão 5

Questão
5. Declaration of variable is not a statement of C# language, but ends with semicolon.
Responda
  • True
  • False

Questão 6

Questão
6. Declaration of variable is a statement of C# language.
Responda
  • True
  • False

Questão 7

Questão
7. Which rule is correct when naming variables?
Responda
  • 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

Questão 8

Questão
8. C# is case sensitive language.
Responda
  • a) yes
  • b) no
  • c) it depends on data type

Questão 9

Questão
9. Choose the correct statement with initializing.
Responda
  • a) string c="0";
  • b) int i="0";
  • c) char c="0";
  • d) int i='0';

Questão 10

Questão
10. What method in C# is Console output?
Responda
  • a) ReadLine
  • b) WriteLine

Questão 11

Questão
11. What method in C# is Console input?
Responda
  • a) ReadLine
  • b) WriteLine

Questão 12

Questão
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);
Responda
  • a) 2+8=10
  • b) 8+2=10
  • c) 10=2+8
  • d) 10=8+2

Questão 13

Questão
13. Choose the incorrect assignment? int i,j;
Responda
  • a) i=j=1;
  • b) i=10,j=10;
  • c) i=(j=10);
  • d) a, b, c

Questão 14

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

Questão 15

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

Questão 16

Questão
16. The “for” statement can be an infinite loop.
Responda
  • True
  • False

Questão 17

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

Questão 18

Questão
18. The statements bodies of the “for” and “while” operators might never be executed.
Responda
  • True
  • False

Questão 19

Questão
19. The statements bodies of the “for” and “while” operators must be executed at least once.
Responda
  • True
  • False

Questão 20

Questão
20. The statements bodies of the “for” and “foreach” operators might never be executed.
Responda
  • True
  • False

Questão 21

Questão
21. The statements bodies of the “for” and “foreach” operators must be executed at least once.
Responda
  • True
  • False

Questão 22

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

Questão 23

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

Questão 24

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

Questão 25

Questão
25. C# procedure specifies with …
Responda
  • a) this keyword
  • b) void keyword
  • c) return data type
  • d) static keyword

Questão 26

Questão
26. An object is …
Responda
  • 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

Questão 27

Questão
27. The classes are like new data types.
Responda
  • True
  • False

Questão 28

Questão
28. Access modifiers are ...
Responda
  • a) void and return data types
  • b) public and private
  • c) data types
  • d) this and static keywords

Questão 29

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

Questão 30

Questão
30. Procedures and constructors can’t be passed any arguments.
Responda
  • True
  • False

Questão 31

Questão
31. Functions can’t be passed any arguments.
Responda
  • True
  • False

Questão 32

Questão
32. Functions can be passed any arguments.
Responda
  • True
  • False

Questão 33

Questão
33. Procedures can’t be passed any arguments.
Responda
  • True
  • False

Questão 34

Questão
34. Procedures can be passed any arguments.
Responda
  • True
  • False

Questão 35

Questão
35. Methods can be passed any arguments.
Responda
  • True
  • False

Questão 36

Questão
36. Methods can’t be passed any arguments.
Responda
  • True
  • False

Questão 37

Questão
37. The default constructor is a method with …
Responda
  • a) any arguments
  • b) no arguments

Questão 38

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

Questão 39

Questão
39. In the static method allowed immediate call only other instance methods.
Responda
  • True
  • False

Questão 40

Questão
40. The “this” keyword can be used for...
Responda
  • a) methods
  • b) functions and procedures
  • c) constructors
  • d) a, b, c

Questão 41

Questão
41. Choose the correct declaration of array.
Responda
  • a) int[] a = int[10];
  • b) int[] c = new int[10];
  • c) int[] a = new [10];
  • d) a, b, c

Questão 42

Questão
42. Choose the correct declaration of jugged array.
Responda
  • a) int [][] j = new int[];
  • b) int [][] j = new int[][5];
  • c) int [][] j = int [5][5];
  • d) int [][] j = new int[5][];

Questão 43

Questão
43. Choose the correct declaration and initialization of array.
Responda
  • 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

Questão 44

Questão
44. Choose the correct declaration of two-dimensional array.
Responda
  • 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];

Questão 45

Questão
45. The last unit (element) index of array is…
Responda
  • a) 0
  • b) 10
  • c) length
  • d) length-1

Questão 46

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

Questão 47

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

Questão 48

Questão
48. C# function specifies with …
Responda
  • a) this keyword
  • b) void keyword
  • c) return data type
  • d) static keyword

Questão 49

Questão
49. The statements body of the “do while” operator might never be executed.
Responda
  • True
  • False

Questão 50

Questão
50. The statements body of the “do while” operator must be executed at least once.
Responda
  • True
  • False

Questão 51

Questão
51. Choose the correct assignment? int i,j;
Responda
  • a) i,j=8;
  • b) i=8,j=8;
  • c) i=(j=8);
  • d) a,b,c;

Questão 52

Questão
52. Constructors can’t be passed any arguments.
Responda
  • True
  • False

Questão 53

Questão
53. Constructors can be passed any arguments.
Responda
  • True
  • False

Questão 54

Questão
54. Default constructors can’t be passed any arguments.
Responda
  • True
  • False

Questão 55

Questão
55. Default constructors can be passed any arguments.
Responda
  • True
  • False

Questão 56

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

Questão 57

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

Questão 58

Questão
58. Hiding an object’s internal implementation detail is…
Responda
  • a) encapsulation
  • b) inheritance
  • c) polymorphism
  • d) composition

Questão 59

Questão
59. Which concept promotes code reuse?
Responda
  • a) encapsulation
  • b) inheritance
  • c) polymorphism
  • d) composition

Questão 60

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

Questão 61

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

Questão 62

Questão
62. Which access modificator (s) related to the data protection?
Responda
  • a) public
  • b) protected
  • c) private
  • d) private and protected

Questão 63

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

Questão 64

Questão
64. Choose traditional technique to encapsulate class’s data.
Responda
  • 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

Questão 65

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

Questão 66

Questão
66. The “Black boxing programming” term is related to
Responda
  • a) inheritance
  • c) objects
  • b) encapsulation
  • d) polymorphism

Questão 67

Questão
67. A “get” method …
Responda
  • 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

Questão 68

Questão
68. A “set” method …
Responda
  • 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

Questão 69

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

Questão 70

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

Questão 71

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

Questão 72

Questão
72. Inheritance of OOP facilities ...
Responda
  • a) data protection
  • b) data hiding
  • c) code reuse

Questão 73

Questão
73. Classical inheritance is …
Responda
  • a) a model of “is-a” relationship
  • b) a model of a “has-a” relationship

Questão 74

Questão
74. The parent class is
Responda
  • a) a child class
  • b) a derived class
  • c) a base class

Questão 75

Questão
75. The extending classes are formally termed...
Responda
  • a) child classes
  • b) parent classes
  • c) base classes

Questão 76

Questão
76. What role of parent class?
Responda
  • 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

Questão 77

Questão
77. A child class inherits the constructor of a parent class.
Responda
  • True
  • False

Questão 78

Questão
78. Which members can never be accessed from parent class?
Responda
  • a) public members
  • b) private members
  • c) protected members
  • d) private and protected

Questão 79

Questão
79. (?)Is it possible to build multiple inheritance for classes in C# language ?
Responda
  • a) yes
  • b) no

Questão 80

Questão
80. Which classes cannot have its child classes?
Responda
  • a) public classes
  • b) sealed classes
  • c) private classes
  • d) derived classes

Questão 81

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

Questão 82

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

Questão 83

Questão
83. The "base" keyword refers to …
Responda
  • a) the parent class
  • b) the child class
  • c) derived class

Questão 84

Questão
84. The process termed "method overriding" is …
Responda
  • 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

Questão 85

Questão
85. A virtual method of a parent class must be overridden for by each derived classes.
Responda
  • True
  • False

Questão 86

Questão
86. A virtual method of a parent class must not be overridden for by each derived classes.
Responda
  • True
  • False

Questão 87

Questão
87. A virtual method of a parent class has its own implementation body block.
Responda
  • True
  • False

Questão 88

Questão
88. A virtual method of a parent class has not its own implementation body block.
Responda
  • True
  • False

Questão 89

Questão
89. An abstract method of a parent class has its own implementation body block.
Responda
  • True
  • False

Questão 90

Questão
90. An abstract method of a parent class has not its own implementation body block.
Responda
  • True
  • False

Questão 91

Questão
91. An abstract method of a parent class must be overridden for by each child class.
Responda
  • True
  • False

Questão 92

Questão
92. An abstract method of a parent class must not be overridden for by each child class.
Responda
  • True
  • False

Questão 93

Questão
93. Which feature is not related to an abstract class?
Responda
  • 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

Questão 94

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

Questão 95

Questão
95. An interface defines …
Responda
  • a) the method signature
  • b) the virtual methods
  • c) the common methods
  • d) the abstract methods

Questão 96

Questão
96. Classes that implement an interface are contractually required to implement the interface signature definition and can’t alter it.
Responda
  • True
  • False

Questão 97

Questão
97. A class can support as many interfaces as necessary.
Responda
  • True
  • False

Questão 98

Questão
98. A class can support only one interface.
Responda
  • True
  • False

Questão 99

Questão
99. A class cannot support as many interfaces as necessary.
Responda
  • True
  • False

Questão 100

Questão
100. "Has-a" relationship is ...
Responda
  • 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

Questão 101

Questão
101. "Has-a" relationship commonly includes ...
Responda
  • a) encapsulation and composition terms
  • b) aggregation and polymorphism terms
  • c) polymorphism and composition terms
  • d) aggregation and composition terms

Questão 102

Questão
102. "Has-a" relationship must establish parent/child relationships.
Responda
  • True
  • False

Questão 103

Questão
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.
Responda
  • True
  • False

Questão 104

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

Questão 105

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

Questão 106

Questão
106. Which class is used to fill shapes?
Responda
  • a) The Brush class
  • b) The Pencil class
  • c) The Pen class
  • d) The Region class

Questão 107

Questão
107. Choose the correct code to specify the location of control?
Responda
  • 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);

Questão 108

Questão
108. Choose the correct code to specify the size of control?
Responda
  • 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);

Questão 109

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

Questão 110

Questão
110. Drawing begins with the ...
Responda
  • a) System.Drawing.Pen class
  • b) System.Drawing.Graphics class
  • c) System.Drawing.Brush class
  • d) System.Drawing.Image class

Questão 111

Questão
111. To use Draw methods of the graphic object, we must provide an instance of the Pen class.
Responda
  • True
  • False

Questão 112

Questão
112. To use Draw methods of the graphic object, we must provide an instance of the Brush class.
Responda
  • True
  • False

Questão 113

Questão
113. Graphics.DrawLines, Graphisc.DrawPolygon, and Graphics.DrawRectangles accept arrays as parameters to allow us to create more complex shapes.
Responda
  • True
  • False

Questão 114

Questão
114. To use Fill methods of the graphic object, we must provide an instance of the Brush class.
Responda
  • True
  • False

Questão 115

Questão
115. To use Fill methods of the graphic object, we must provide an instance of the Pen class.
Responda
  • True
  • False

Questão 116

Questão
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!
Responda
  • True
  • False

Questão 117

Questão
117. An enumerated type is declared using the … keyword. Answer: Enum
Responda
  • True
  • False

Questão 118

Questão
118. By default, the first enumerator has the value…
Responda
  • 0
  • 1
  • 2
  • 9

Questão 119

Questão
119. C# structures are created with … keyword.
Responda
  • struct
  • new
  • is

Questão 120

Questão
120. Virtual methods are defined in …
Responda
  • Parent class
  • Child class

Questão 121

Questão
121. What big advantage of using interfaces ?
Responda
  • Is that class can implement multiple interfaces;
  • Is that class can not implement multiple interfaces;

Questão 122

Questão
122. Is it enough to create polymorphic methods using the "virtual" and "override" keywords?
Responda
  • True
  • False

Questão 123

Questão
123. Inheritance allows to build …
Responda
  • a dependency between two or more class
  • a dependency only between two

Questão 124

Questão
174. Which of the following returns true if at least one expression is true?
Responda
  • and
  • or

Questão 125

Questão
175. Which of the following returns true if two expressions are true?
Responda
  • and
  • not

Questão 126

Questão
176. The keywords of the Switch statement are ...
Responda
  • switch, case default, goto, return, throw
  • for, case default, goto, return, throw
  • begin,end,swap

Questão 127

Questão
125. The int type is …
Responda
  • value,predefined
  • reference,predefined
  • value,user-defined
  • reference,user-defined

Questão 128

Questão
126. The bool type is …
Responda
  • value,predefined
  • reference,predefined
  • value,user-defined
  • reference,user-defined

Questão 129

Questão
127. The char type is …
Responda
  • value,predefined
  • reference,predefined
  • value,user-defined
  • reference,user-defined

Questão 130

Questão
128. The long type is …
Responda
  • value,predefined
  • reference,predefined
  • value,user-defined
  • reference,user-defined

Questão 131

Questão
129. The float type is …
Responda
  • value,predefined
  • reference,predefined
  • value,user-defined
  • reference,user-defined

Questão 132

Questão
130. The double type is …
Responda
  • value,predefined
  • reference,predefined
  • value,user-defined
  • reference,user-defined

Questão 133

Questão
131. The class type is …
Responda
  • reference, user-defined
  • value,predefined
  • value,user-defined
  • reference,predefined

Questão 134

Questão
132. The interface type is …
Responda
  • reference, user-defined
  • value,user-defined
  • value,predefined
  • reference,predefined

Questão 135

Questão
133. The object type is…
Responda
  • value,predefined
  • value,user-defined
  • reference,user-defined
  • reference,predefined

Questão 136

Questão
134. The string type is …
Responda
  • reference,predefined
  • value,predefined
  • value,user-defined
  • reference,user-defined

Questão 137

Questão
135. The struct type is …
Responda
  • value, user-defined
  • reference,user-defined
  • value,predefined
  • reference,predefined

Questão 138

Questão
136. The enum type is …
Responda
  • value, user-defined
  • reference,user-defined
  • reference,predefined
  • value,predefined

Semelhante

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