Вы находитесь на странице: 1из 8

1. Which type of inheritance C# not allowed.

Multiple
Multi-level
Single
Hierarchical

2. The ________ keyword allows you to access the variables and methods of the base class
from the derived class
super
this
base
parent

3. The _________ keyword can either be used as an operator or as a modifier in C#.


base
new
super
this

4. The instance of the derived class will always first invoke the _________ of the base class
Destructor
Constructor
Method
Abstract method

5. ______________ a method in the derived class can change the body of the method that
was declared in the base class
Shadowing
Overloading
Overriding
Implementation

6. _______ is a keyword used to declare a method in the base class that can be overridden
by the derived class
override
virtual
abstract
anonymous

7. The ________ keyword prevents a class from being inherited by any other class.
sealed
final
abstract
static
8. compile time polymorphism referred to as _______
static polymorphism
dynamic polymorphism
default polymorphism
runtime polymorphism

9. Which of these statements about sealed classes are true?


(A) The seal keyword is used to declare a class as sealed.
(B) A sealed class is used to ensure security by preventing any modification to its existing
methods.
(C) A sealed class is also referred to as final class in C#.
(D) A sealed class is a class whose data members cannot be modified.
(E) A sealed class is used to support the functioning of the virtual keyword.

A, B, D
B, D
A, C
B, E

10. ____________ allows you to create a new class from another class, thereby inheriting
its common properties and methods
Abstraction
Encapsulation
Inheritance
Polymorphism

11. It is not mandatory for the abstract class to contain only abstract methods.
True
False

12. An abstract class can be sealed class.


True
False

13. In C#, by default, all members declared in an interface have _______ as the access
modifier
private
public
protected
internal
14. ________ cannot contain constants, data fields, constructors, destructors, and static
members.
Abstract classes
Sealed classes
Static classes
Interfaces

15. The ___ and ____ operators in C# verify whether the specified interface is implemented
or not.
this, base
is, as
is, this
as, base

16. Which of these statements about abstract classes and abstract methods are true?
(A) An abstract class can be declared using the declare keyword.
(B) An abstract class cannot be instantiated using the new keyword.
(C) An abstract class can be created by declaring and defining methods.
(D) An abstract method can be declared without an access modifier.
(E) An abstract method can be implemented in the inheriting class using the override
keyword.

A, B, D
B, C, D
A, C
B, E

17. Which of these statements about interfaces are true?


(A) An interface can contain abstract as well as implemented methods.
(B) An inheriting class can override the implemented methods of an interface.
(C) A class can implement abstract methods from multiple interfaces.
(D) A class can explicitly implement multiple interfaces when the interfaces have
methods
with identical names.
(E) An interface can implement multiple interfaces but only a single abstract class

A, B, D
C, D
A, C
B, E

18. Which of the following are the correct statements about delegates?
A. Delegates can be used to implement callback notification
B. Delegates permit execution of a method on a secondary thread in an asynchronous
manner
C. Delegate is a user defined type
D. All of the mentioned

A
B
C
D

19. Select the namespace which should be included while making use of LINQ operations:
A. System.Tex
B. System.Collections.Generic
C. System.Linq
D. None of the mentioned
A
B
C
D

20. The conversion of a value type instance to an object is called __________.


a. Boxing
b. Unboxing
c. Both A & B
d. None

21. Which of these can be overloaded?


a) Constructors
b) Methods
c) Both Constructors & Methods
d) None of the mentioned

22. What is the process of defining a method in terms of itself, that is a method that calls
itself?
a) Polymorphism
b) Abstraction
c) Encapsulation
d) Recursion

23. The process of defining a method in a subclass having same name & type signature as a
method in its superclass is known as?
a) Method overloading
b) Method overriding
c) Method hiding
d) None of the mentioned

24. Which of the given modifiers can be used to prevent Method overriding?
a) Static
b) Constant
c) Sealed
d) final

25. Which of the following cannot be used to declare a class as a virtual?


a) Methods
b) Properties
c) Events
d) Fields

26. When we call a constructor method among different given constructors. We match the
suitable constructor by matching the name of constructor first, then the number and
then the type of parameters to decide which constructor is to be overloaded. The
process is also known as?
a) Method overriding
b) Inheritance
c) Polymorphism
d) Encapsulation

27. Choose the keyword which declares the indexer?


a) base
b) this
c) super
d) extract

28. Which among the following are the advantages of using indexers?
a) To use collection of items at a large scale we make use of indexers as they utilize
objects of class that represent the collection as an array
b) Indexers are also convenient as they can also make use of different types of indexers
like int, string etc
c) An indexer allows an object to be indexed such as an array
d) All of the mentioned

29. Choose the correct option among the following indexers which correctly allows to index
in same way as an array?
a) A class
b) An interface
c) A function
d) A property

30. Where the properties can be declared?


a) Class
b) Struct
c) Interface
d) All of the mentioned

31. Consider a class maths and we had a property called as sum.b which is the reference to
a maths object and we want the statement Console.WriteLine(b.sum) to fail. Which
among the following is the correct solution to ensure this functionality?
a) Declares sum property with only get accessor
b) Declares sum property with only set accessor
c) Declares sum property with both set and get accessor
d) Declares sum property with both set, get and normal accessor

32. Select the correct statement about an Exception?


a) It occurs during loading of program
b) It occurs during Just-In-Time compilation
c) It occurs at run time
d) All of the mentioned

33. Which of these keywords is not a part of exception handling?


a) try
b) finally
c) thrown
d) catch

34. Which of these keywords is used to manually throw an exception?


a) try
b) finally
c) throw
d) catch

35. Which of these clauses will be executed even if no exceptions are found?
a) throws
b) finally
c) throw
d) catch

36. Which of these exceptions handles the divide by zero error?


a) ArithmeticException
b) MathException
c) IllegalAccessException
d) IllegarException

37. Which of these exceptions will occur if we try to access the index of an array beyond its
length?
a) ArithmeticException
b) ArrayException
c) ArrayArguementException
d) IndexOutOfRangeException

38. Which of these classes is related to all the exceptions that are explicitly thrown?
a) Error
b) Exception
c) Throwable
d) Throw

39. Select the type of multitasking methods that exist:


a) process based
b) thread based
c) only process
d) both process & thread based

40. Choose the namespace which supports multithreading programming?


a) System.net
b) System.Linq
c) System.Threading
d) All of the mentioned

41. On call of which type of method the new created thread will not start executing?
a) Begin()
b) Start()
c) New()
d) All of the mentioned

42. Which of these methods of Thread class is used to Suspend a thread for a period of
time?
a) sleep()
b) terminate()
c) suspend()
d) stop()

43. Which method is called when a thread is blocked from running temporarily?
a) Pulse()
b) PulseAll()
c) Wait()
d) Both Pulse() & Wait()

Вам также может понравиться