Online Exam Quiz

questionQuestion  1 to 30

What does 'CLR' stand for?

  • Common Language Runtime
  • Common Language Resource
  • Common Language Repository
  • Common Link Runtime
Mark for review

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

  • 3
  • 3.33
  • 3
  • 10-Mar
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

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

  • SQL Server
  • OLE DB
  • XML
  • Oracle
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 '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 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

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

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

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

  • Start()
  • Run()
  • Begin()
  • Initiate()
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 main difference between 'String' and 'StringBuilder' in C#?

  • String is mutable
  • StringBuilder is immutable
  • StringBuilder is mutable
  • Both are immutable
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 value of an uninitialized bool variable in C#?

  • TRUE
  • FALSE
  • null
  • undefined
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 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 valid method to handle exceptions?

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

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 statements is true about .NET assembly?

  • It is always a DLL
  • It is always an EXE
  • It can be either DLL or EXE
  • It is a namespace
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 maximum size of a Decimal in C#?

  • 4 bytes
  • 8 bytes
  • 16 bytes
  • 32 bytes
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 these is not a valid C# data type?

  • short
  • long
  • byte
  • float64
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 true about 'ref' keyword in C#?

  • It allows passing a value by reference
  • It allows passing a reference by value
  • It allows passing a value by value
  • It allows passing a reference by reference
Mark for review

What is the extension of a .NET assembly?

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

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

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

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

  • override
  • new
  • overload
  • extends
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