Pregunta de entrevista de Sagitec Solutions

dictionary, hashtable, var , dynamic

Respuesta de la entrevista

Anónimo

8 oct 2020

1.Dictionary is one of the generic collection, It saves the data in key value pair and it is type safe collection, as there no boxing and unboxing happen. 2. Hashtable is a simple collection type and it is key value pair collection and object based, so boxing and unboxing happens several times, so it's not type safe and performance overhead. 3. Var is a implicitly typed variable, it checkes a type at compile time. Variable with var should be initialized and we can't initialize it with null. Basically it has came into picture for anonymous types. 4. Dynamic is a dynamic variable which checks the type at runtime and we add any type of value and we can initialize it multiple time and anytime.

1