OOP
Does C# support multiple inheritance?
Yes
No
Which .NET collection class allows elements to be accessed using a unique key?
ListDictionary
Stack
Hashtable
ArrayList
StringCollection
If a method is marked as protected internal, who can access it?
Classes that are both in the same assembly and derived from the declaring class
Only methods that are in the same class as the method in question
Internal methods can only be called using reflection
Classes within the same assembly, and classes derived from the declaring class
What is boxing?
Encapsulating an object in a value type
Encapsulating a copy of a value type in an object
Encapsulating a copy of an object in value type
Encapsulating a value type in an object
In Object Oriented Programming, which answer best describes encapsulation?
The conversion of one type of object to another
The runtime resolution of method calls
The exposition of data
The separation of interface and implementation
Can you change the value of a variable while debugging a C# application?
Yes
No
The capability of an object in Csharp to take number of different forms and hence display behaviour as according is known as:
Encapsulation
Polymorphism
Abstraction
Nheritance
Which of the following keyword is used to change data and behavior of a base class by replacing a member of the base class with a new derived member?
Overloads
Overrides
New
Base
Class
Choose the correct statements about enum used in C#.NET?
An enum variable cannot have a private access modifier
An enum variable can be defined inside a class or a namespace
An enum variable cannot have a protected access modifier
An enum variable cannot have a public access modifier
None of these
Which among the following cannot be used as a datatype for an enum in C#.NET?
Short
Double
Int
All of the mentioned above
None of these
The number of levels of inheritance are?
5
4
3
2
What does the following code signify?
Declaration of a base class
Declaration of a sub class
Declaration of base class & sub class and how subclass inherits the base class
Declaration of abstract class
None of the mentioned
In an inheritance chain through which of following, the base class and its components are accessible to the derived class?
Scope resolution operator(:)
Class visibilty modifiers (public,private etc.)
Dot operator (.)
All of the mentioned
Select the class visibility modifiers among the following :
Private, protected, public, internal
Ï‚· Private, protected, public, internal, protected internal
Private, protected, public
Wrong statement about inheritance in C# .NET?
In inheritance chain, object construction begins from base class towards derived class
Inheritance cannot extend base class functionality
A derived class object contains all base class data
Inheritance enables you to create new classes that reuse, extend, and modify the behavior that is defined in other classes.
All of the mentioned
Which of the following functionality is facilitated by inheritance mechanism?
Use the existing functionality of base class
Override the existing functionality of base class
Implements new functionality in derived class
All of the mentioned above
None of the mentioned above
Which statements among following are correct?
We can derive a class from a base class even if source code of base class not available
Multiple inheritance is different from multiple levels of inheritance
It is legal to make objects of one class as members of another class
All of the mentioned above
None of the mentioned above
Which is the correct way to create an object of the given class abc?
Declaring existing class as sealed
Declaring existing class as override
Declaring existing class as overloads
Declaring existing class as shadows
None of these
Given class sample is inherited by class sample 1. Which are the correct statements about construction of object of class sample?
While creating the object firstly the constructor of class sample will be called followed by constructor of class sample 1
The constructor of only sample class will be called
While creating the object firstly constructor of class sample 1 will be called followed by constructor of class sample
The order of calling constructors depend on whether constructors in class sample and sample 1 are private or public
None of these
Which form of inheritance is not supported directly by C# .NET?
Multiple inheritance
Multilevel inheritance
Single inheritance
Hierarchical inheritance
The process of defining two or more methods within the same class that have same name but different parameters list?
Method overloading
Method overriding
Encapsulation
Abstraction
None of the mentioned
38. Which of these can be overloaded?
Constructors o ï‚·
Both a & b
Methods
All of the mentioned above
Which keyword is used to declare a base class method while performing overidding of base class methods?
This
Virtual o o
Extend
Override
None of the mentioned
The process of defining a method in subclass having same name & type signature as a method in its superclass is known as?
Method overloading
Method overriding
Method hiding
Abstraction
None of the mentioned
Which of the given modifiers can be used to prevent Method overriding?
Static o
Sealed
Constant
Final o
None of the mentioned
Select the correct statement from the following?
Static methods can be a virtual method
Abstract methods can be a virtual method
When overriding a method, the names and type signatures of the override method must be the same as the virtual method that is being overriden
We can override virtual as well as non virtual methods
None of the mentioned
Which of the following cannot be used to declare a class as a virtual?
Methods o
None of the mentioned
Properties
Events
Fields
The modifier used to hide the base class methods is?
Dvd
None of the mentioned
Override
New
Sealed
To override a method in subclass, baseclass method should be defined as?
Virtual
Override
Abstract
All of the mentioned above
None of the mentioned above
A type of class which does not have its own objects but acts as a base class for its subclass is known as?
Static class
None of the mentioned
Sealed class
Abstract class
Interface
The modifier used to define a class which does not have objects of its own but acts as a base class for its subclass is?
Sealed o o ï‚· o
Interface
New
Abstract
Static
Choose the correct statements among the following:
An abstract method does not have implementation
An abstract method can take either static or virtual modifiers
An abstract method can be declared only in abstract class
All of the mentioned above
None of the mentioned above
Which of the following modifiers is used when an abstract method is redefined by a derived class?
O Overloads
Override
Base
Virtual
None of these
Which of these keywords is used to refer to member of base class from a sub class?
Upper
None of the mentioned
This
Base
Which statements are correct?
If a base class consists of a member function fun() and a derived class do not have any function with this name. An object of derived class can access fun().
A class D can be derived from class C, which is derived from class B which in turn is derived from class A.
If a base class and a derived class each include a member function with same name,the member function of the derived class will be called by object of derived class
All of the above mentioned
None of these
Choose the wrong statement about structures in C#.NET?
Structures can be declared within a procedure
Structures can implement an interface but they cannot inherit from another structure
Structure members cannot be declared as protected
A structure cannot be empty
None of the mentioned
When does a structure variable get destroyed?
When no reference refers to it,it will get garbage collected
Depends on whether it is created using new or without new operator
As variable goes out of the scope
Depends on either we free its memory using free() or delete()
None of the mentioned
Select the wrong statements among the following?
A structure can contain constants o
None of the mentioned
A structure can contain constructors
A structure can contain properties o
A structure can contain protected data memb
Choose the correct statement about structures as to why they are defined as value types but not reference types?
Since space required for structure variables is allocated on stack which is a form of memory that is automatically available when a variable to be used is in scope.
Structures generally are used to represent user defined data types that consists of small amount of data in them.Hence using stack for declaration of such variables is not a problem.
All of the mentioned
None of the mentioned
Choose the correct statement among the following which supports the fact that C# does not allow the creation of empty structures?
C#.NET supports creation of abstract user-defined data types using structures
By having empty structures,it would mean that the new data types have no data associated with, which does not make any sense in C#.NET
Basic reason to create structures is the inability to represent real life objects using standard data types offered by the language
All of the above mentioned
Choose the wrong statement about ‘INTERFACE’ in C#.NET?
Interfaces are declared public automatically
An explicitly implemented member could be accessed from an instance of the interface
An interface could not contain signature of the indexer
None of the mentioned
Which among the following is not the ordered collection class?
BitArray
Queue
None of the mentioned
Stack
Which among the following is not an interface declared in System.Collection namespace?
IDictionaryComparer
Icomparer
IEnumerato
IEnumerable
Which is the correct statement about an ArrayList collection that implements the IEnumerable interface?
To access members of ArrayList from the inner class, it is necessary to pass ArrayList class’s reference to it
The inner class of ArrayList can access ArrayList class’s members
The ArrayList class consist of inner class that implements the IEnumerator interface
All of the mentioned
Among the given collections which one is I/O index based?
ArrayList
Queue
Stack
List
Which among the given statements are correct about the Stack collection?
It can be used for evaluation of expressions
It is used to maintain a LIFO list
Top most element of the Stack collection can be accessed using the Peek()
All of the mentioned
{"name":"OOP", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Does C# support multiple inheritance?, Which .NET collection class allows elements to be accessed using a unique key?, If a method is marked as protected internal, who can access it?","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}
More Quizzes
TFAW Employee Quiz
520
English placement assessment
41200
How well you know Kyle Peart
1260
Quran Quiz (part 7)
10522
Travel Desk - COVID 19 Quiz
15816
XUA ART
1268
100
LRP Cream Formulation Event
210
Professional Accounting Student Society
100
Gender Equality
1050
February/March 2017 - New Hire Training SME Sales Week 4
30150
The Dong
320