IN C#:
A/Which of the following statements is not true?
| 1)CLR will take of care of managed objects on the heap with your direct involvement |
2) | When a class is instantiated using the "new" keyword, an actual object of that type is returned rather than a reference to the object on the heap |
3) | Garbage collector is responsible for managing the lifetime of an object on the heap |
4) | Garbage collector uses object generation to locate unreachable objects on the heap |
5) | You should always call GC.WaitForPendingFinalizers() when forcing garbage collection |
B/Deferred execution means
| 1)LINQ query expressions are executed in the calling code |
2) | LINQ query expressions are never executed more than once |
3) | LINQ query expressions are always executed regardless of the caller |
4) | LINQ query expressions are not actually evaluated until you iterate over the sequence |
5) | LINQ query expressions execute at the exact moment you call them |
c/All of the following are characteristics of an immutable object, except:
1) | All reference types are immutable |
2) | State of an immutable object does not change once the object has been created |
3) | A class is immutable if its instances are immutable |
4) | Provides thread safety in code |
5) | Provides better quality of data |
d/All of the statements about generics are true, except:
1) | Generics reduce the need to define overloaded methods |
2) | Custom generic methods must be defined inside a custom generic class only |
3) | When you have a group of overloaded methods that differ only by incoming arguments, this is your clue that generics should be used |
4) | When you invoke generic methods, you can optionally omit the type parameter if (and only if) the generic method requires arguments because the compiler can infer the type parameter based on the member parameters |
5) | Generic methods and classes can contain constraints |