1. Explain the life cycle of an ASP .NET page.
Ans :
Page: Init
Page: PreLoad
Page: Load
Page: PreRender
Page: Render
Page: Unload
2.Explain the .NET architecture?
The order starting from the bottom
1. CLR (Common Language Runtime)
2. .Net framework base classe
3. ASP.Net Web Form / Windows Form
3. What is abstract class?
Abstract class connot be instantiated instead it has to be inherited. The methods in abstract class can be overridetn in the child class.
4.What is difference between interface inhertance and class inheritance?
Class inheritance: copy attributes and operations defined in a super class into its subclass. We only add new attributes and operations specific to the sub class. A sub class may override a super class features (attributes and operations) by defining a feature with the same name.
Interface inheritance: inherit only the signature defined in an abstract operation. We prepare the different implementation of method in each concrete sub class. And we invoke them with the same signature.
5.What are the collection classes?
collection is the set of object instances of the same class.
The .NET Framework provides specialized classes for data storage and retrieval.
These classes provide support for stacks, queues, lists, and hash tables.
6.What inheritance does VB.NET support
VB .NET supports object-oriented inheritance (but not multiple inheritance).
7.What is a runtime host?
The common language runtime has been designed to support a variety of different types of applications, from Web server applications to applications with a traditional rich Windows user interface. Each type of application requires a runtime host to start it. The runtime host loads the runtime into a process, creates the application domains within the process, and loads user code into the application domains.
Runtime Host Description
ASP.NET
Loads the runtime into the process that is to handle the Web request. ASP.NET also creates an application domain for each Web application that will run on a Web server.
Microsoft Internet Explorer
Creates application domains in which to run managed controls. The .NET Framework supports the download and execution of browser-based controls. The runtime interfaces with the extensibility mechanism of Microsoft Internet Explorer through a mime filter to create application domains in which to run the managed controls. By default, one application domain is created for each Web site.
Shell executables
Invokes runtime hosting code to transfer control to the runtime each time an executable is launched from the shell.
8.Differences between application and session
Application state is a state where we hav the information that is global for the application,
where as
session state is a state which is maintained as a per-client basis.
whenever a user first accesses a page a session id is generated by asp.net.
that session id is then transmitted between the client and the server via Http either with the help of client-side cookies or encoded in a mangled sessions of the urls.
so the next time the users accesses,state associated with that session id can be viewed or modified
9.Will the following code execute successfully: response.write(’value of i=’+i);
10.What are the Difference between bstract base classes and Abstrat classes
An abstract class is one which cannot be instantiated; you can't create its objects like the way you do for concrete classes. But abstract classes can contain concrete as well as abstract methods (methods with no body). Besides, an abstract class can have all members concrete.
If an abstract class contains atleast one method which is abstract (or pure virtual function in C++), then we call it as an Abstract Base Class (ABC).
11.Explain serialization?
Serialization is the process of storing an object, including all of its public and private fields, to a stream. Deserialization is the opposite – restoring an object's field values from a stream.
12.What is the difference between overloading and overriding ? how can this be .NET
Over Loading and Overriding :--
In a class if two method is having the same name and different signature,its known as overloading in Object oriented concepts.
For eg Take the case of a Shape Class. having a method with a name DrawShape();
This method has two definitins with different parameters.
1. public void DrawShape(int x1, int y1,int x2,int y2)
{
// draw a rectangle.
}
2. public void DrawShape(int x1,int y1)
{
// draw aline.
}
These two method does different operation based on the parameters. so through the same
interface (method name) the user is will be able to do multiple tasks (draw line and rectangle).This is called over loading, and is an example of polymorphism.
Overriding :--
Overriding means, to give a specific definition by the derived class for a method implemented in the base class.
For eg.
Class Rectangle
{
publc void DrawRectangle()
{
// this method will draw a rectangle.
}
}
Class RoundRectangle : Rectanlge
{
public void DrawRectangle()
{
//Here the DrawRectangle() method is overridden in the
// derived class to draw a specific implementation to the
//derived class, i.e to draw a rectangle with rounded corner.
}
}
In the above example, the RoundedRectangle class needs to have its own
implementation of the DrawRectangle() method,i.e to draw a rectangle with
rounded corners. so it overloaded and gave it implementation.
13.Explain friend and protected friend?
Friend/Internal - Method, Properties in a class can be accessed by all the classes within that particular assembly.
Protected Friend/Protected Internal - Methods, Properties can be accessed by all the classes in that particular assembly and also by the child classes of that particular class.
Saturday, November 10, 2007
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment