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")

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


www.codecollege.NET

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


www.codecollege.NET

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();
}

}
}



www.codecollege.NET

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.


www.codecollege.NET

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



www.codecollege.NET

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


www.codecollege.NET

Aculis .NET interview Questions

1. can you declare a private
constructor
2. constructor calling hierarchy a>b>c
3.how will
singleton maintain sinlge instance when diff console apps
call
differently
4. when will u go for abstract class and interface
5. can you
do like this
interface a
{
}

class aCls :
a
{
}

class Me
{

a a1 = new aCls();
a1.
will this
produce all the methods or members of aCls?

6. what are the components of
a Factory class
7. exlpain chain of responsibility in detail
8. how will
you call a base class constructor from a derived class
9. how will you call a
method using reflection
10. what denotes () when you create an object
a a1
= new a();
11. is global.asax mandatory for a webapp
12. what is a
webpart
13. why are you creating a usercontrol for deploying in
sharepoint
14. have u used serialization
15. whats the diff bet binary and
xml serialization
16. if an object throws "cannot
be serialized error " what will you
do?


www.codecollege.NET

Photon Info Tech .NET and Sharepoint interview Questions

1. How will you decide which mode you should
go like Inproc, Stateserver , Sqlserver?
2. Have you configure SSO,
Sharedservices?
3. what are Webparts?
4. what is Infopath?
5. Explain
in details about BDC ?
6. have you used Sharepoint object model?

7. How will you deploy a sharepoint
webpart?




 


www.codecollege.NET

DELL .NET interview Questions

1. Garbage collectors in detail
2. Unique
identifiers
3. Delegates some practical example
4. In webfarms what
session management will u use
5. types of session management.
6.
indexes
7. how will u create a clustered index
8. what is a web.config
file
9. types of indexes
10. what is the lates version of asp.net
11.
what is the diff bet asp.net 2.0 and asp.net 3.0
12. what is the diff bet
.net2.0,3.0adn 3.5 and 3.7
13. how will u implement the following
abstract
class a{
get(){}
}
interface a{
get();
}
14. what is the diff
bet abstract class and interface
15. how will u manage sessions
16. what
are all the methods that get loaded in a page life cycle
17. where will you
be able to access the viewstate
18. if 2 applications(teams) are using the
same sessions variable , then how will u maintain the
consistency


www.codecollege.NET

What is the difference between ref & out parameters?


An argument passed to a ref parameter must first be initialized whereas argument passed to out parameter need not be initialized.


www.codecollege.NET

What is Active Directory? What is the namespace used to access the Microsoft Active Directories?


 Active Directory is simply defined as the meta data collection for users and objects and their configuration along with their management. Active Directory in Windows 2000 utilizes the Domain Naming Service (DNS) standard for naming objects.



Active Directory Service Interfaces (ADSI)
is a programmatic interface for Microsoft Windows Active Directory. It enables
your applications to interact with diverse directories on a network, using a
single interface. Visual Studio .NET and the .NET Framework make it easy to add ADSI functionality with the DirectoryEntry and DirectorySearcher components.





face=Arial>System.DirectoryServices
namespace is used to access MS Active Directory.


www.codecollege.NET

What are the different types of assemblies in .NET?


There are 3 types of assemblies in .net , they are

1. Private
2. Public or Shared
3. Satellite


www.codecollege.NET

Which namespace is the base class for all .net Class libraries?


System.object


www.codecollege.NET

What are Generics in .NET?


Generics allow you to define type-safe data structures, without committing to actual data types.


www.codecollege.NET

What does Ghosted and Unghosted mean in Sharepoint?


Ghosted:


Ghosted means that when SharePoint creates a new site it will reference the files in the related site definition upon site provisioning.


Unghosted:


Unghosted means that the site has been edited with an external editor, and therefore the customizations are instead stored in the database.



www.codecollege.NET

What is a SharePoint site definition?


A site definition is a group of files that reside on the Web server and that define a unique type of SharePoint site.


www.codecollege.NET

What is a content type?


A content type is a reusable collection of settings you want to apply to a certain category of content. Content types enable you to manage the metadata and behaviors of a document or item type in a centralized, reusable way.


www.codecollege.NET

From what base classes can a sharepoint webpart be created?


You can create a Webpart in sharepoint by inheriting from two base classes,
1. System.Web.UI.WebControls.WebParts
2. Microsoft.SharePoint.WebParts


www.codecollege.NET

LinkWithin

Blog Widget by LinkWithin

Recommended Books