Hello World
Quiz by , created more than 1 year ago

Quiz on oop, created by Hello World on 20/01/2017.

401
5
0
No tags specified
Hello World
Created by Hello World almost 8 years ago
Close

oop

Question 1 of 138

1

1. C-style languages are

Select one of the following:

  • a) C, C#

  • b) C, C++

  • c) C, C#, C++

  • d) C, C#, C++, Java

  • e) C#, C++

Explanation

Question 2 of 138

1

2. Choose the incorrect statement for C style languages.

Select one of the following:

  • 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

Explanation

Question 3 of 138

1

3. Which aspects does variable have?

Select one of the following:

  • a) type, size and memory address

  • b) memory address, type and value

  • c) type and value

  • d) value, size and memory address

Explanation

Question 4 of 138

1

4. What declaration of variables is the correct?

Select one of the following:

  • a) char c;i;

  • b) int b;c;

  • c) char c, char s;

  • d) double a, b;

Explanation

Question 5 of 138

1

5. Declaration of variable is not a statement of C# language, but ends with semicolon.

Select one of the following:

  • True
  • False

Explanation

Question 6 of 138

1

6. Declaration of variable is a statement of C# language.

Select one of the following:

  • True
  • False

Explanation

Question 7 of 138

1

7. Which rule is correct when naming variables?

Select one of the following:

  • 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

Explanation

Question 8 of 138

1

8. C# is case sensitive language.

Select one of the following:

  • a) yes

  • b) no

  • c) it depends on data type

Explanation

Question 9 of 138

1

9. Choose the correct statement with initializing.

Select one of the following:

  • a) string c="0";

  • b) int i="0";

  • c) char c="0";

  • d) int i='0';

Explanation

Question 10 of 138

1

10. What method in C# is Console output?

Select one of the following:

  • a) ReadLine

  • b) WriteLine

Explanation

Question 11 of 138

1

11. What method in C# is Console input?

Select one of the following:

  • a) ReadLine

  • b) WriteLine

Explanation

Question 12 of 138

1

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);

Select one of the following:

  • a) 2+8=10

  • b) 8+2=10

  • c) 10=2+8

  • d) 10=8+2

Explanation

Question 13 of 138

1

13. Choose the incorrect assignment? int i,j;

Select one of the following:

  • a) i=j=1;

  • b) i=10,j=10;

  • c) i=(j=10);

  • d) a, b, c

Explanation

Question 14 of 138

1

14. What will be the result? int i=5; int j=1; int x=(j--)+(--i);

Select one of the following:

  • a) x=6;

  • b) x=5;

  • c) x=7;

  • d) x=8;

Explanation

Question 15 of 138

1

15. What will be the result? int x=10,i=0,j=2; x+=(i-j);

Select one of the following:

  • a) 14

  • b) 10

  • c) 12

  • d) 8

Explanation

Question 16 of 138

1

16. The “for” statement can be an infinite loop.

Select one of the following:

  • True
  • False

Explanation

Question 17 of 138

1

17. Choose the incorrect For statement?

Select one of the following:

  • a) for(;;){}

  • b) for( int x = 0, x<= 100; x++){}

  • c) int x = 0;
    for(; x<= 100; x++){}

  • d) a,b,c

Explanation

Question 18 of 138

1

18. The statements bodies of the “for” and “while” operators might never be executed.

Select one of the following:

  • True
  • False

Explanation

Question 19 of 138

1

19. The statements bodies of the “for” and “while” operators must be executed at least once.

Select one of the following:

  • True
  • False

Explanation

Question 20 of 138

1

20. The statements bodies of the “for” and “foreach” operators might never be executed.

Select one of the following:

  • True
  • False

Explanation

Question 21 of 138

1

21. The statements bodies of the “for” and “foreach” operators must be executed at least once.

Select one of the following:

  • True
  • False

Explanation

Question 22 of 138

1

22. In what statement the Statements body is always executed at least once?

Select one of the following:

  • a) for, do while, while

  • b) do while

  • c) foreach, while

  • d) do while, for

Explanation

Question 23 of 138

1

23. C# classes contain:

Select one of the following:

  • a) properties and functions

  • b) data members(field, variables), properties and methods

  • c) method, functions and constructors

  • d) variables and methods

Explanation

Question 24 of 138

1

24. The properties in C# classes are…

Select one of the following:

  • a) procedures and functions

  • b) constructors

  • c) data members(variables)

  • d) members with get and set

Explanation

Question 25 of 138

1

25. C# procedure specifies with …

Select one of the following:

  • a) this keyword

  • b) void keyword

  • c) return data type

  • d) static keyword

Explanation

Question 26 of 138

1

26. An object is …

Select one of the following:

  • 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

Explanation

Question 27 of 138

1

27. The classes are like new data types.

Select one of the following:

  • True
  • False

Explanation

Question 28 of 138

1

28. Access modifiers are ...

Select one of the following:

  • a) void and return data types

  • b) public and private

  • c) data types

  • d) this and static keywords

Explanation

Question 29 of 138

1

29. A public method with the same name as the class with no return type is ...

Select one of the following:

  • a) constructor

  • b) function

  • c) procedure

  • d) property

Explanation

Question 30 of 138

1

30. Procedures and constructors can’t be passed any arguments.

Select one of the following:

  • True
  • False

Explanation

Question 31 of 138

1

31. Functions can’t be passed any arguments.

Select one of the following:

  • True
  • False

Explanation

Question 32 of 138

1

32. Functions can be passed any arguments.

Select one of the following:

  • True
  • False

Explanation

Question 33 of 138

1

33. Procedures can’t be passed any arguments.

Select one of the following:

  • True
  • False

Explanation

Question 34 of 138

1

34. Procedures can be passed any arguments.

Select one of the following:

  • True
  • False

Explanation

Question 35 of 138

1

35. Methods can be passed any arguments.

Select one of the following:

  • True
  • False

Explanation

Question 36 of 138

1

36. Methods can’t be passed any arguments.

Select one of the following:

  • True
  • False

Explanation

Question 37 of 138

1

37. The default constructor is a method with …

Select one of the following:

  • a) any arguments

  • b) no arguments

Explanation

Question 38 of 138

1

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

Select one of the following:

  • True
  • False

Explanation

Question 39 of 138

1

39. In the static method allowed immediate call only other instance methods.

Select one of the following:

  • True
  • False

Explanation

Question 40 of 138

1

40. The “this” keyword can be used for...

Select one of the following:

  • a) methods

  • b) functions and procedures

  • c) constructors

  • d) a, b, c

Explanation

Question 41 of 138

1

41. Choose the correct declaration of array.

Select one of the following:

  • a) int[] a = int[10];

  • b) int[] c = new int[10];

  • c) int[] a = new [10];

  • d) a, b, c

Explanation

Question 42 of 138

1

42. Choose the correct declaration of jugged array.

Select one of the following:

  • a) int [][] j = new int[];

  • b) int [][] j = new int[][5];

  • c) int [][] j = int [5][5];

  • d) int [][] j = new int[5][];

Explanation

Question 43 of 138

1

43. Choose the correct declaration and initialization of array.

Select one of the following:

  • 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

Explanation

Question 44 of 138

1

44. Choose the correct declaration of two-dimensional array.

Select one of the following:

  • 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];

Explanation

Question 45 of 138

1

45. The last unit (element) index of array is…

Select one of the following:

  • a) 0

  • b) 10

  • c) length

  • d) length-1

Explanation

Question 46 of 138

1

46. How many elements does the next array include? Int[] a=new int[77];

Select one of the following:

  • a) 76

  • b) 77

  • c) 78

Explanation

Question 47 of 138

1

47. How many elements does the next array include? Int[] a=new int[100];

Select one of the following:

  • a) 99

  • b) 100

  • c) 101

Explanation

Question 48 of 138

1

48. C# function specifies with …

Select one of the following:

  • a) this keyword

  • b) void keyword

  • c) return data type

  • d) static keyword

Explanation

Question 49 of 138

1

49. The statements body of the “do while” operator might never be executed.

Select one of the following:

  • True
  • False

Explanation

Question 50 of 138

1

50. The statements body of the “do while” operator must be executed at least once.

Select one of the following:

  • True
  • False

Explanation

Question 51 of 138

1

51. Choose the correct assignment? int i,j;

Select one of the following:

  • a) i,j=8;

  • b) i=8,j=8;

  • c) i=(j=8);

  • d) a,b,c;

Explanation

Question 52 of 138

1

52. Constructors can’t be passed any arguments.

Select one of the following:

  • True
  • False

Explanation

Question 53 of 138

1

53. Constructors can be passed any arguments.

Select one of the following:

  • True
  • False

Explanation

Question 54 of 138

1

54. Default constructors can’t be passed any arguments.

Select one of the following:

  • True
  • False

Explanation

Question 55 of 138

1

55. Default constructors can be passed any arguments.

Select one of the following:

  • True
  • False

Explanation

Question 56 of 138

1

56. How many elements does the next array include? int[] a=new int[99];

Select one of the following:

  • a) 99

  • b) 100

  • c) 101

Explanation

Question 57 of 138

1

57. Choose the core principles of OOP

Select one of the following:

  • a) Encapsulation and Inheritance

  • b) Encapsulation, Inheritance and Polymorphism

  • c) encapsulation and polymorphism

  • d) encapsulation, inheritance, polymorphism, aggregation and composition

Explanation

Question 58 of 138

1

58. Hiding an object’s internal implementation detail is…

Select one of the following:

  • a) encapsulation

  • b) inheritance

  • c) polymorphism

  • d) composition

Explanation

Question 59 of 138

1

59. Which concept promotes code reuse?

Select one of the following:

  • a) encapsulation

  • b) inheritance

  • c) polymorphism

  • d) composition

Explanation

Question 60 of 138

1

60. Which statement shows Encapsulation concept?

Select one of the following:

  • a) string s = “Hello World!”;

  • b) int a,b=0;

  • c) b++;

  • d) string s = “hello”, bool i=s.Equals(“!”);

Explanation

Question 61 of 138

1

61. Closely related to the notion of encapsulating programming logic is the idea of…

Select one of the following:

  • a) overriding

  • b) data protection

  • c) overloading

  • d) realization

Explanation

Question 62 of 138

1

62. Which access modificator (s) related to the data protection?

Select one of the following:

  • a) public

  • b) protected

  • c) private

  • d) private and protected

Explanation

Question 63 of 138

1

63. Members of a class that represent an object’s state should not be marked as

Select one of the following:

  • a) public

  • b) private

  • c) protected

Explanation

Question 64 of 138

1

64. Choose traditional technique to encapsulate class’s data.

Select one of the following:

  • 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

Explanation

Question 65 of 138

1

65. Choose a technique to encapsulate class’s data

Select one of the following:

  • a) Define fields of class

  • b) Define your own constructor

  • c) Define a public properties

  • d) Define a private properties

Explanation

Question 66 of 138

1

66. The “Black boxing programming” term is related to

Select one of the following:

  • a) inheritance

  • c) objects

  • b) encapsulation

  • d) polymorphism

Explanation

Question 67 of 138

1

67. A “get” method …

Select one of the following:

  • 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

Explanation

Question 68 of 138

1

68. A “set” method …

Select one of the following:

  • 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

Explanation

Question 69 of 138

1

69. Is it possible to perform any internal logic necessary before making the value assignment in properties of class?

Select one of the following:

  • a) yes

  • b) no

Explanation

Question 70 of 138

1

70. Which keyword is related to the "get" block of property?

Select one of the following:

  • a) value

  • b) return

  • c) this

  • d) public

Explanation

Question 71 of 138

1

71. Which keyword is related to the "set" block of property?

Select one of the following:

  • a) value

  • b) return

  • c) this

  • d) public

Explanation

Question 72 of 138

1

72. Inheritance of OOP facilities ...

Select one of the following:

  • a) data protection

  • b) data hiding

  • c) code reuse

Explanation

Question 73 of 138

1

73. Classical inheritance is …

Select one of the following:

  • a) a model of “is-a” relationship

  • b) a model of a “has-a” relationship

Explanation

Question 74 of 138

1

74. The parent class is

Select one of the following:

  • a) a child class

  • b) a derived class

  • c) a base class

Explanation

Question 75 of 138

1

75. The extending classes are formally termed...

Select one of the following:

  • a) child classes

  • b) parent classes

  • c) base classes

Explanation

Question 76 of 138

1

76. What role of parent class?

Select one of the following:

  • 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

Explanation

Question 77 of 138

1

77. A child class inherits the constructor of a parent class.

Select one of the following:

  • True
  • False

Explanation

Question 78 of 138

1

78. Which members can never be accessed from parent class?

Select one of the following:

  • a) public members

  • b) private members

  • c) protected members

  • d) private and protected

Explanation

Question 79 of 138

1

79. (?)Is it possible to build multiple inheritance for classes in C# language ?

Select one of the following:

  • a) yes

  • b) no

Explanation

Question 80 of 138

1

80. Which classes cannot have its child classes?

Select one of the following:

  • a) public classes

  • b) sealed classes

  • c) private classes

  • d) derived classes

Explanation

Question 81 of 138

1

81. Which members of parent class cannot be accessed to other classes, but can be accessed to its child classes?

Select one of the following:

  • a) all members

  • b) public members

  • c) private members

  • d) protected members

Explanation

Question 82 of 138

1

82. Another use of the "this" keyword is to design a class using a technique termed…

Select one of the following:

  • a) constructor definition

  • b) constructor creation

  • c) constructor chaining

  • d) constructor using

Explanation

Question 83 of 138

1

83. The "base" keyword refers to …

Select one of the following:

  • a) the parent class

  • b) the child class

  • c) derived class

Explanation

Question 84 of 138

1

84. The process termed "method overriding" is …

Select one of the following:

  • 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

Explanation

Question 85 of 138

1

85. A virtual method of a parent class must be overridden for by each derived classes.

Select one of the following:

  • True
  • False

Explanation

Question 86 of 138

1

86. A virtual method of a parent class must not be overridden for by each derived classes.

Select one of the following:

  • True
  • False

Explanation

Question 87 of 138

1

87. A virtual method of a parent class has its own implementation body block.

Select one of the following:

  • True
  • False

Explanation

Question 88 of 138

1

88. A virtual method of a parent class has not its own implementation body block.

Select one of the following:

  • True
  • False

Explanation

Question 89 of 138

1

89. An abstract method of a parent class has its own implementation body block.

Select one of the following:

  • True
  • False

Explanation

Question 90 of 138

1

90. An abstract method of a parent class has not its own implementation body block.

Select one of the following:

  • True
  • False

Explanation

Question 91 of 138

1

91. An abstract method of a parent class must be overridden for by each child class.

Select one of the following:

  • True
  • False

Explanation

Question 92 of 138

1

92. An abstract method of a parent class must not be overridden for by each child class.

Select one of the following:

  • True
  • False

Explanation

Question 93 of 138

1

93. Which feature is not related to an abstract class?

Select one of the following:

  • 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

Explanation

Question 94 of 138

1

94. An interface is defined using...

Select one of the following:

  • a) the capital letter “I” in the name

  • b) the interface keyword

  • c) the abstract keyword

  • d) the virtual keyword

Explanation

Question 95 of 138

1

95. An interface defines …

Select one of the following:

  • a) the method signature

  • b) the virtual methods

  • c) the common methods

  • d) the abstract methods

Explanation

Question 96 of 138

1

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

Select one of the following:

  • True
  • False

Explanation

Question 97 of 138

1

97. A class can support as many interfaces as necessary.

Select one of the following:

  • True
  • False

Explanation

Question 98 of 138

1

98. A class can support only one interface.

Select one of the following:

  • True
  • False

Explanation

Question 99 of 138

1

99. A class cannot support as many interfaces as necessary.

Select one of the following:

  • True
  • False

Explanation

Question 100 of 138

1

100. "Has-a" relationship is ...

Select one of the following:

  • 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

Explanation

Question 101 of 138

1

101. "Has-a" relationship commonly includes ...

Select one of the following:

  • a) encapsulation and composition terms

  • b) aggregation and polymorphism terms

  • c) polymorphism and composition terms

  • d) aggregation and composition terms

Explanation

Question 102 of 138

1

102. "Has-a" relationship must establish parent/child relationships.

Select one of the following:

  • True
  • False

Explanation

Question 103 of 138

1

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.

Select one of the following:

  • True
  • False

Explanation

Question 104 of 138

1

104. The .NET Framework allows to work with graphics using the ...

Select one of the following:

  • a) System.Drawing namespace

  • b) System.IO namespace

  • c) System.Windows.Form namespace

  • d) System.Data namespace

Explanation

Question 105 of 138

1

105. Which class is used to draw lines, curves and shapes?

Select one of the following:

  • a) The Brush class

  • b) The Pencil class

  • d) The Region class

  • c) The Pen class

Explanation

Question 106 of 138

1

106. Which class is used to fill shapes?

Select one of the following:

  • a) The Brush class

  • b) The Pencil class

  • c) The Pen class

  • d) The Region class

Explanation

Question 107 of 138

1

107. Choose the correct code to specify the location of control?

Select one of the following:

  • 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);

Explanation

Question 108 of 138

1

108. Choose the correct code to specify the size of control?

Select one of the following:

  • 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);

Explanation

Question 109 of 138

1

109. Which properties of controls can be used to specify its location?

Select one of the following:

  • a) Size

  • b) Left, Right, Top, Bottom

  • c) ForeColor and BlackColor

  • d) Left, Right

Explanation

Question 110 of 138

1

110. Drawing begins with the ...

Select one of the following:

  • a) System.Drawing.Pen class

  • b) System.Drawing.Graphics class

  • c) System.Drawing.Brush class

  • d) System.Drawing.Image class

Explanation

Question 111 of 138

1

111. To use Draw methods of the graphic object, we must provide an instance of the Pen class.

Select one of the following:

  • True
  • False

Explanation

Question 112 of 138

1

112. To use Draw methods of the graphic object, we must provide an instance of the Brush class.

Select one of the following:

  • True
  • False

Explanation

Question 113 of 138

1

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

Select one of the following:

  • True
  • False

Explanation

Question 114 of 138

1

114. To use Fill methods of the graphic object, we must provide an instance of the Brush class.

Select one of the following:

  • True
  • False

Explanation

Question 115 of 138

1

115. To use Fill methods of the graphic object, we must provide an instance of the Pen class.

Select one of the following:

  • True
  • False

Explanation

Question 116 of 138

1

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!

Select one of the following:

  • True
  • False

Explanation

Question 117 of 138

1

117. An enumerated type is declared using the … keyword. Answer: Enum

Select one of the following:

  • True
  • False

Explanation

Question 118 of 138

1

118. By default, the first enumerator has the value…

Select one of the following:

  • 0

  • 1

  • 2

  • 9

Explanation

Question 119 of 138

1

119. C# structures are created with … keyword.

Select one of the following:

  • struct

  • new

  • is

Explanation

Question 120 of 138

1

120. Virtual methods are defined in …

Select one of the following:

  • Parent class

  • Child class

Explanation

Question 121 of 138

1

121. What big advantage of using interfaces ?

Select one of the following:

  • Is that class can implement multiple interfaces;

  • Is that class can not implement multiple interfaces;

Explanation

Question 122 of 138

1

122. Is it enough to create polymorphic methods using the "virtual" and "override" keywords?

Select one of the following:

  • True
  • False

Explanation

Question 123 of 138

1

123. Inheritance allows to build …

Select one of the following:

  • a dependency between two or more class

  • a dependency only between two

Explanation

Question 124 of 138

1

174. Which of the following returns true if at least one expression is true?

Select one of the following:

  • and

  • or

Explanation

Question 125 of 138

1

175. Which of the following returns true if two expressions are true?

Select one of the following:

  • and

  • not

Explanation

Question 126 of 138

1

176. The keywords of the Switch statement are ...

Select one of the following:

  • switch, case default, goto, return, throw

  • for, case default, goto, return, throw

  • begin,end,swap

Explanation

Question 127 of 138

1

125. The int type is …

Select one of the following:

  • value,predefined

  • reference,predefined

  • value,user-defined

  • reference,user-defined

Explanation

Question 128 of 138

1

126. The bool type is …

Select one of the following:

  • value,predefined

  • reference,predefined

  • value,user-defined

  • reference,user-defined

Explanation

Question 129 of 138

1

127. The char type is …

Select one of the following:

  • value,predefined

  • reference,predefined

  • value,user-defined

  • reference,user-defined

Explanation

Question 130 of 138

1

128. The long type is …

Select one of the following:

  • value,predefined

  • reference,predefined

  • value,user-defined

  • reference,user-defined

Explanation

Question 131 of 138

1

129. The float type is …

Select one of the following:

  • value,predefined

  • reference,predefined

  • value,user-defined

  • reference,user-defined

Explanation

Question 132 of 138

1

130. The double type is …

Select one of the following:

  • value,predefined

  • reference,predefined

  • value,user-defined

  • reference,user-defined

Explanation

Question 133 of 138

1

131. The class type is …

Select one of the following:

  • reference, user-defined

  • value,predefined

  • value,user-defined

  • reference,predefined

Explanation

Question 134 of 138

1

132. The interface type is …

Select one of the following:

  • reference, user-defined

  • value,user-defined

  • value,predefined

  • reference,predefined

Explanation

Question 135 of 138

1

133. The object type is…

Select one of the following:

  • value,predefined

  • value,user-defined

  • reference,user-defined

  • reference,predefined

Explanation

Question 136 of 138

1

134. The string type is …

Select one of the following:

  • reference,predefined

  • value,predefined

  • value,user-defined

  • reference,user-defined

Explanation

Question 137 of 138

1

135. The struct type is …

Select one of the following:

  • value, user-defined

  • reference,user-defined

  • value,predefined

  • reference,predefined

Explanation

Question 138 of 138

1

136. The enum type is …

Select one of the following:

  • value, user-defined

  • reference,user-defined

  • reference,predefined

  • value,predefined

Explanation