what is Dotnet Module, dynamic keyword and
Last day I have been interviewed and the interviewer asked me
a) what is dotnet Modules?
b) What is the 开发者_开发技巧new dynamic keyword and what is it's use(dot net 4.0)
c) what is the difference between dynamic keyword and var(dotnet 3.5+)
d) What is the difference between Var & Object? Why should we use one over another?
Could anyone be kind enough in answering this.
Thanks.
From Module Statement
Modules are a reference type similar to classes, but with some important distinctions. The members of a module are implicitly Shared and scoped to the declaration space of the standard module's containing namespace, rather than just to the module itself. Unlike classes, modules can never be instantiated, do not support inheritance, and cannot implement interfaces. A module can only be declared in a namespace and cannot be nested in another type.
From dynamic (C# Reference)
The dynamic type enables the operations in which it occurs to bypass compile-time type checking. Instead, these operations are resolved at run time. The type simplifies access to COM APIs such as the Office Automation APIs, and also to dynamic APIs such as IronPython libraries, and to the HTML Document Object Model (DOM).
And [c#] dynamic vs var
精彩评论