
Good Practices on C#
Quiz by Titan
Feel free to use or edit a copy
includes Teacher and Student dashboards
Measure skillsfrom any curriculum
Measure skills
from any curriculum
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
With a free account, teachers can
- edit the questions
- save a copy for later
- start a class game
- automatically assign follow-up activities based on students’ scores
- assign as homework
- share a link with colleagues
- print as a bubble sheet
20 questions
Show answers
- Q1What will be the output of the following program ?Runtime ErrorCompile-Time Error0Random Value30s
- Q2Which of the following is the default access modifier in a namespace ?ProtectedInternalPublicPrivate30s
- Q3Which 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
- Q4The finally block is always executed irrespective of whether an exception occurs or notTrueFalseDepends on the way exception is handled30s
- Q5What 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
- Q6What will be the output of the following program ?Error occurred!Error occurred! Executing finally block Executing remaining programError occurred! Executing finally blockExecuting finally block45s
- Q7Which of the following keyword is used to raise an exception manually ?returnthrowraiseerror30s
- Q8What is boxing in .NET ?None of the aboveConverts primitive type to value typeConverts reference type to value typeConverts value type to object30s
- Q9Which 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 aboveDIPIoCIoC Container30s
- Q10Which of the following standard query operator returns the difference between the two collections ?UnionIntersectExceptDistinct30s
- Q11What 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
- Q12Which return type is not supported in an ASYNC method ?voidTaskintTask60s
- Q13Which of the following operator does not throw an exception if the cast fails ?is=()as60s
- Q14Which of the following type escapes type checking at compile-time, instead it resolves type at run time ?nullvarundefineddynamic60s
- Q15What will be the output of the following program ?Null error occurred!Index error occurred!Compile-time errorError occurred!60s