.NET - Dynamic Programming
5.
Name the binders provided by .NET Framework 4.0.
.NET Framework 4.0 provides the following binders:
- Object Binder - Enables to communicate with .NET objects.
- JavaScript Binder - Enables to communicate with JavaScript in Silverlight.
- Python Binder - Enables to communicate with IronPython.
- Ruby Binder - Enables to communicate with IronRuby.
- COM Binder - Enables to communicate with COM.
6.
Explain ExpandoObject and DynamicObject classes.
The ExpandoObject class refers to a class whose members can be explicitly added and removed at runtime. In other words, the ExpandoObject class allows dynamic binding of the objects, which enables you to use standard syntax, similar to the dynobj.Method method instead of using more complex syntax, such as dynobj.getAttribute("Method").
The DynamicObject class enables you to define the dynamic behavior for an object at run time. This class cannot be instantiated directly; therefore, to implement the dynamic behavior, you must inherit from the DynamicObject class and override the necessary methods. It allows you to define the specific operations that can be performed on dynamic objects as well the methods to perform those operations.
The DynamicObject class enables you to define the dynamic behavior for an object at run time. This class cannot be instantiated directly; therefore, to implement the dynamic behavior, you must inherit from the DynamicObject class and override the necessary methods. It allows you to define the specific operations that can be performed on dynamic objects as well the methods to perform those operations.
7.
What is the difference between dynamic and var data types?
The difference between the var and dynamic data types is that the var data type is strongly type checked at the compile time; whereas, the dynamic data type is type checked by the compiler only at run time. After declaring a var data type, you cannot explicitly change its type throughout the execution of the program; however, a variable of the dynamic data type can be changed during runtime. Another major difference between the two is that dynamic type can also be used as the return type for methods, for which var cannot be used.
8.
Which class is used for converting the data types?
The System.Convert class provides a complete set of methods for converting the data types.
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers