placeholder image to represent content

Good Practices on C#

Quiz by Titan

Our brand new solo games combine with your quiz, on the same screen

Correct quiz answers unlock more play!

New Quizalize solo game modes
20 questions
Show answers
  • Q1
    What will be the output of the following program ?
    Question Image
    Runtime Error
    Compile-Time Error
    0
    Random Value
    30s
  • Q2
    Which of the following is the default access modifier in a namespace ?
    Protected
    Internal
    Public
    Private
    30s
  • Q3
    Which of the following statements is TRUE ?
    A readonly field can be initialized either at the declaration or in a constructor or static methods.
    A readonly field can be initialized either at the declaration or in a constructor.
    A readonly field can only be initialized at the declaration.
    A readonly field can only be initialized in a constructor.
    30s
  • Q4
    The finally block is always executed irrespective of whether an exception occurs or not
    True
    False
    Depends on the way exception is handled
    30s
  • Q5
    What is the difference between var and dynamic type ?
    var is mutable, whereas dynamic is immutable.
    Both are same, no differences.
    The actual type of var resolves at runtime, whereas the type of dynamic type resolves at compile-time.
    The actual type of var resolves at compile-time, whereas the type of dynamic type resolves at runtime.
    30s
  • Q6
    What will be the output of the following program ?
    Question Image
    Error occurred!
    Error occurred! Executing finally block Executing remaining program
    Error occurred! Executing finally block
    Executing finally block
    45s
  • Q7
    Which of the following keyword is used to raise an exception manually ?
    return
    throw
    raise
    error
    30s
  • Q8
    What is boxing in .NET ?
    None of the above
    Converts primitive type to value type
    Converts reference type to value type
    Converts value type to object
    30s
  • Q9
    Which principle suggests "High-level modules should not depend on low level-modules. Both should depend on abstraction. Abstractions should not depend on details. Details should depend on abstractions".
    None of the above
    DIP
    IoC
    IoC Container
    30s
  • Q10
    Which of the following standard query operator returns the difference between the two collections ?
    Union
    Intersect
    Except
    Distinct
    30s
  • Q11
    What is the difference between First and FirstOrDefault ?
    First returns NULL whereas FirstOrDefault returns default value, if no elements found for specified criteria.
    First returns void whereas FirstOrDefault returns NULL value, if no elements found for specified criteria.
    First throws an exception whereas FirstOrDefault returns NULL, if no elements found for specified criteria.
    First throws an exception whereas FirstOrDefault returns default value, if no elements found for specified criteria.
    60s
  • Q12
    Which return type is not supported in an ASYNC method ?
    void
    Task
    int
    Task
    60s
  • Q13
    Which of the following operator does not throw an exception if the cast fails ?
    is
    =
    ()
    as
    60s
  • Q14
    Which of the following type escapes type checking at compile-time, instead it resolves type at run time ?
    null
    var
    undefined
    dynamic
    60s
  • Q15
    What will be the output of the following program ?
    Question Image
    Null error occurred!
    Index error occurred!
    Compile-time error
    Error occurred!
    60s

Teachers give this quiz to your class