What is compile time binding and run time binding? (or) What is early/late binding? Explain with an example.

Thursday, July 9, 2009


An object is early bound when it is assigned to a variable declared to be of a specific
object type. Early bound objects allow the compiler to allocate memory and perform other

optimizations before an application executes.



' Create a variable to hold a new object.

Dim FS As FileStream

' Assign a new object to the variable.

FS = New FileStream("C:\tmp.txt", FileMode.Open)



By contrast, an object is late bound when it is assigned to a variable declared to
be of type Object. Objects of this type can hold references to any object, but lack
many of the advantages of early-bound objects.


Dim xlApp As Object

xlApp = CreateObject("Excel.Application")


www.codecollege.NET

Which method will be called from the following code? (or) Explain Polymorphism with override Modifier in c#.


using System;
using System.Collections.Generic;
using System.Text;

namespace OOPs21
{
class BaseClass
{
public virtual string ShowMe()
{

return "base";
}
}
class DerivedClass : BaseClass
{
public override string ShowMe()
{

return "derive";
}

public static void CallShowME(BaseClass objBC)
{
Console.Write(objBC.ShowMe());
}


public static void Main()
{
DerivedClass vardc = new DerivedClass();
CallShowME(vardc);
Console.Read();
}

}
}




Answer:

derive


Which method will be called from the following code? (or) Explain Polymorphism with New Modifier


using System;
using System.Collections.Generic;
using System.Text;

namespace OOPs21
{
class BaseClass
{
public string ShowMe()
{

return "base";
}
}
class DerivedClass : BaseClass
{
public new string ShowMe()
{

return "derive";
}

public static void CallShowME(BaseClass objBC)
{
Console.Write(objBC.ShowMe());
}


public static void Main()
{
DerivedClass vardc = new DerivedClass();
CallShowME(vardc);
Console.Read();
}

}
}




Answer:

base


How to use the new modifier in hiding base class method?


using System;
using System.Collections.Generic;
using System.Text;

namespace OOPs21
{
class BaseClass
{
public string ShowMe()
{

return "base";
}
}
class DerivedClass : BaseClass
{
public new string ShowMe()
{

return "derive";
}


public static void Main()
{
DerivedClass vardc = new DerivedClass();
Console.Write(vardc.ShowMe());
Console.ReadLine();
}

}
}







What is Pinvoke?






Platform invoke is a service that enables managed code to call unmanaged functions implemented in dynamic-link libraries (DLLs), such as those in the Win32 API. It locates and invokes an exported function and marshals its arguments (integers, strings, arrays, structures, and so on) across the interoperation boundary as needed.





Applied Development .NET interview Questions

1. what is a webservice and how it
works
2. what is a proxy
3. what is multilevel inheritance and multiple
inheritance
4. what is the use of multilevel inheritance
5. how ajax
works
6. what is mvp
7. what cons u need to take in designing database
table
8. what cons u need to take in writing stored procs
9. what are
indexes ,types
10. if a web app is running slowly how will u increase the
performance
11. how will u check the performance of methods in a class
12.
how will u either turn on or off methods ina class
13. i want to write some
code in all page_loads automatically how, will i do it
14. where(which layer)
will u write your excep hand
15. what is trace and debug
16. how will u
enable or disbale it
17. which design patterns u have used
18. what is
chain of responsibility
19. From which class Textbox control is
inherited
20. what is inner exception20.
21. what will u avoid when
writting sps


CapGemini .NET interview Questions

1. how will you mange sessions in asp.net
2.
what happens to the session when you go between pages
3. what is
autoeventwireup
4. what are infopath forms and how r they published
5.
where do a sharepoint webpart inherit form
6. what are the diff bet the 2
webparts
7. if u have 2 classes a,b and b is derived from a .in both
class's
constructor a mess box is called. If i create an object for B
then
which will be called first
8. how will u check whether the user is
supportig cookies
9. how will u do cookieless sessions
10. explain about
session management
11. when will u go for what type of session
management
12. caching, types, how
13. where are session details stored
between pages
14. when will u go for interface and when will u go for
abstract classes
15. how will u communicate bet user controls
16. how will u deploy a
webpart in sharepoint and what are the
diff

Blog Widget by LinkWithin