Online Exam Quiz

questionQuestion  1 to 30

What is the use of the 'lock' statement in C#?

  • To provide a handle to a thread
  • To prevent multiple threads from accessing a resource
  • To release a thread from waiting
  • To end the execution of a thread
Mark for review

What is the purpose of 'override' keyword in C#?

  • To hide a method
  • To define a new method
  • To override a base class method
  • To extend a class
Mark for review

What is the purpose of the 'base' keyword in C#?

  • To define a base class
  • To call a method in the base class
  • To create a new base class
  • To define an abstract class
Mark for review

Which of the following is true about the 'sealed' keyword in C#?

  • It allows a class to be inherited
  • It prevents a class from being inherited
  • It allows a method to be overridden
  • It prevents a method from being overridden
Mark for review

What is the maximum size of a Decimal in C#?

  • 4 bytes
  • 8 bytes
  • 16 bytes
  • 32 bytes
Mark for review

What is LINQ?

  • Language Integrated Query
  • Local Integrated Query
  • Language Interface Query
  • Local Interface Query
Mark for review

What is the purpose of the 'yield' keyword in C#?

  • To create a lambda expression
  • To define a delegate
  • To return multiple values from a method
  • To simplify the implementation of an iterator
Mark for review

Which of the following is true about 'const' keyword in C#?

  • The value can be changed at runtime
  • The value cannot be changed at runtime
  • It defines a method
  • It defines a variable that can be changed
Mark for review

Which of the following is NOT a valid method to handle exceptions?

  • try
  • catch
  • final
  • finally
Mark for review

What is the default value of an uninitialized bool variable in C#?

  • TRUE
  • FALSE
  • null
  • undefined
Mark for review

Which of the following is NOT a built-in delegate in C#?

  • Func
  • Action
  • Predicate
  • Transformer
Mark for review

How do you mark a method as asynchronous in C#?

  • Using the 'async' keyword
  • Using the 'await' keyword
  • Using the 'thread' keyword
  • Using the 'task' keyword
Mark for review

How do you prevent a class from being inherited in C#?

  • By using the 'sealed' keyword
  • By using the 'final' keyword
  • By using the 'static' keyword
  • By using the 'readonly' keyword
Mark for review

Which of the following is used to manage memory in .NET?

  • Garbage Collection
  • Finalizer
  • Destructor
  • All of the above
Mark for review

What is the main advantage of using LINQ?

  • Better performance
  • Type safety
  • Code readability
  • All of the above
Mark for review

What is the purpose of the 'using' statement in C#?

  • To include namespaces
  • To manage unmanaged resources
  • To declare a constant variable
  • To import classes from other namespaces
Mark for review

What is the extension of a .NET assembly?

  • .dll
  • .exe
  • Both
  • .com
Mark for review

What is the purpose of the 'is' keyword in C#?

  • To check the type of an object
  • To cast an object to a different type
  • To compare two objects
  • To define a new type
Mark for review

What is the main advantage of using delegates in C#?

  • Type safety
  • Performance
  • Code readability
  • None of the above
Mark for review

Which namespace is used for managing a collection of key/value pairs?

  • System.Collection.Generic.Dictionary
  • System.Collections.Specialized.NameValueCollection
  • System.Collections.Queue
  • System.Collections.Stack
Mark for review

What is the use of 'throw' keyword in C#?

  • To catch an exception
  • To create an exception
  • To throw an exception
  • To log an exception
Mark for review

Which keyword is used to overload a method in C#?

  • override
  • new
  • overload
  • extends
Mark for review

What is the purpose of the 'params' keyword in C#?

  • To pass an unknown number of parameters
  • To define optional parameters
  • To define named parameters
  • To define output parameters
Mark for review

What is the purpose of the 'static' keyword in C#?

  • To define a constant value
  • To define a variable that is shared among all instances
  • To define a method that cannot be overridden
  • To define a method that is specific to an instance
Mark for review

Which interface provides a non-generic collection of objects?

  • IEnumerable<T>
  • ICollection
  • IList
  • IEnumerable
Mark for review

What is the main advantage of using properties in C#?

  • Type safety
  • Performance
  • Encapsulation
  • None of the above
Mark for review

What is the default access modifier for a class in C#?

  • public
  • private
  • internal
  • protected
Mark for review

What does the 'finally' block do in exception handling?

  • It executes only when an exception occurs
  • It executes only when no exception occurs
  • It executes regardless of an exception
  • It stops the execution of the catch block
Mark for review

What is the purpose of the 'virtual' keyword in C#?

  • To define a new method
  • To override a base class method
  • To allow a method to be overridden
  • To prevent a method from being overridden
Mark for review

Which of these is not a valid C# data type?

  • short
  • long
  • byte
  • float64
Mark for review

blinkerOnline

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • Answered
  • Not Answered
  • Marked for Review