1. ctype(123.34,integer) - should it throw an error? Why or why not?
No,It is valid conversion
2. directcast(123.34,integer) - should it throw an error? Why or why not?
Yes,doulbe is not inhertited from integer both are of not same types,
3. Difference between a sub and a function
Sub doesnt return value,Where as function Returns
4. Explain manifest & metadata.
Manifest describes Assembly,security,Versioning,Culture,StrongNames
Metadata destcribes content in Assembly ,classes,enums,interfaces
5.What happens in memory when you Box and Unbox a value-type
Boxing converts valuetype to reference type ,thus storing object to heap.
Unboxing converts reference type to Value Type thus storing object on Stack.
6.What namespaces are necessary to create a localized application?
System.Resources
7.What namespaces are required to work with dll?
System.InteropServices.
8.Scope of public/private/internal/protected/protected internal
public
The type or member can be accessed by any other code in the same assembly or another assembly that references it.
private
The type or member can only be accessed by code in the same class or struct.
protected
The type or member can only be accessed by code in the same class or struct, or in a derived class.
internal
The type or member can be accessed by any code in the same assembly, but not from another assembly.
protected internal
The type or member can be accessed by any code in the same assembly, or by any derived class in another assembly.
9.Difference between imperative and interrogative code
Imperative -Return value
Interrogative -Doesnot return value
10.What is Raise event
Raise Event is used for raising events. ex raising control event from main page .
11.Describe ways of cleaning up objects
GC.collect
Finalize
Dispose methods
12.Where does Dispose method lie?
The dispose method is available in System.IDisposable interface.If you want to provide cleanup mechanism then implement this interface and provide the definition for dispose() method
13.Can you configure a .NET Remoting object via XML file?
Yes, via machine.config and web.config in ASP.NET. Application-level XML settingstake precedence over machine.config.
14.Explain Web.config Settings for exception management in ASP.NET.
You should configure exception management settings within your application's Web.config file. The following is an example of the exception settings in a Web.config file.
< defaultredirect="http://hostname/error.aspx" mode="On">
< statuscode="500" redirect="/errorpages/servererror.aspx">
< statuscode="404" redirect="/errorpages/filenotfound.htm">
< /customErrors>
In the customErrors element, specify a default redirect page. There are three modes for the default redirect page:
On -Unhandled exceptions will redirect the user to the specified defaultredirect page. This is used mainly in production.
Off-Users will see the exception information and not be redirected to the defaultredirect page. This is used mainly in development.
RemoteOnly- Only users accessing the site on the local machine (using localhost) will see the exception information while all other users will be redirected to the defaultredirect page. This is used mainly for debugging.
15.What are Generics?
Generics are used to have Typed Arrays.
Ex: if we have define that an array is confined to products.if we push objects of product into array it accepts.if we push employee objects into this array it will showerror . since the type of the array is product
17.What is Global Assembly Cache (GAC) and what is the Purpose of it?
The GAC or the Global Assembly Cache in .NET Framework acts as the central place for registering assemblies.It enables you to share assemblies across numerous applications
18.How to find methods of a assembly file not using ILDASM
Using system.reflection
19.What is use of ContextUtil class?
ContextUtil is the preferred class to use for obtaining COM+ context information.
20.How do you turn off cookies for one page in your site?
Cookie.Discard
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment