1. A) Garbage collector is responsible for managing the

Added on -2019-09-23

| 3 pages
| 809 words

Trusted by 2+ million users,
1000+ happy students everyday

Showing pages 1 to 1 of 3 pages

1. A) Garbage collector is responsible for managing the lifetime of an object on the heap2. B) LINQ query expressions are always executed regardless of the caller3. C) Provides thread safety in code4. D) when you have a group of overloaded methods that differ only by incoming arguments, thisis your clue that generics should be used6)Extension MethodExtension Methods furnish the developer with the figment that the sorts can be broadened,regardless of whether the source code isn't accessible or if the sort is fixed... what's more, with nocompelling reason to make inferred classes. In addition, those augmentations can be connected toexamples of the sorts stretched out at run-time, notwithstanding who has made those occasions.In all actuality this is only a hallucination upheld by the compiler, however it works entirelywell.An extension method is a static method of a static class that can be invoked like as an instancemethod syntax. Extension methods are used toadd new behaviors to an existing typewithoutaltering.In extension method "this" keyword is used with the first parameter and the first parameter willbe oftypethat is extended by extension method. Other parameters of extensions types can be ofany types (data type).Example://defining extension methodpublic static class MyExtensions{public static int WordCount(this String str){return str.Split(new char[] { ' ', '.', ',' }).Length;}}class Program{

Found this document preview useful?

You are reading a preview
Upload your documents to download
Become a Desklib member to get accesss

Students who viewed this