Online Exam Quiz

questionQuestion  1 to 30

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 base class for all exceptions in .NET?

  • System.Exception
  • System.ApplicationException
  • System.SystemException
  • System.Runtime.InteropServices.ExternalException
Mark for review

Which of the following is a value type in .NET?

  • System.String
  • System.Collections.ArrayList
  • System.Int32
  • System.Object
Mark for review

Which method is used to start a thread in C#?

  • Start()
  • Run()
  • Begin()
  • Initiate()
Mark for review

What is the output of Console.WriteLine(10/3); in C#?

  • 3
  • 3.33
  • 3
  • 10-Mar
Mark for review

Which of these is a valid statement to define a nullable type?

  • int? num
  • Nullable<int> num
  • Both
  • None
Mark for review

Which of the following is NOT a .NET data provider?

  • SQL Server
  • OLE DB
  • XML
  • Oracle
Mark for review

What is an extension method in C#?

  • A method that extends the size of an array
  • A method that adds new functionality to a type
  • A method that extends the life of a variable
  • A method that extends the scope of a variable
Mark for review

Which of the following statements is true about interfaces in C#?

  • Interfaces can have fields
  • Interfaces can have method definitions
  • Interfaces can be instantiated
  • Interfaces can be implemented by classes
Mark for review

What is the main advantage of using LINQ?

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

Which of the following is true about an abstract class?

  • It can be instantiated
  • It cannot be inherited
  • It can contain abstract methods
  • It cannot contain non-abstract methods
Mark for review

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

  • try
  • catch
  • final
  • finally
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

What is LINQ?

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

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

  • short
  • long
  • byte
  • float64
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 main difference between 'String' and 'StringBuilder' in C#?

  • String is mutable
  • StringBuilder is immutable
  • StringBuilder is mutable
  • Both are immutable
Mark for review

Which of the following is NOT a valid access modifier in C#?

  • public
  • protected internal
  • internal protected
  • private
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

Which of the following classes is immutable?

  • String
  • StringBuilder
  • List
  • Dictionary
Mark for review

How do you define a read-only property in C#?

  • public int MyProperty { get; }
  • public int MyProperty { get; set; }
  • public readonly int MyProperty { get; }
  • public int MyProperty { get { return _myProperty; } }
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 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 classes allows a collection to grow or shrink dynamically?

  • Array
  • LinkedList
  • List
  • ArrayList
Mark for review

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

  • Func
  • Action
  • Predicate
  • Transformer
Mark for review

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

  • It refers to the current instance of a class
  • It refers to the base class
  • It is used to create a new instance
  • It is used to call a base class method
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

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

  • Type safety
  • Performance
  • Code readability
  • None of the above
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

What is the extension of a .NET assembly?

  • .dll
  • .exe
  • Both
  • .com
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