Sunteți pe pagina 1din 10

2/21/2011 .

NET Framework Interview questions Page 1


Learn jQuery with eBook, Demo app + Source code and Video tutorials.

Chat with
us

GTalk:
DotNetFunda
Skype:
DotNetFunda

Home Tutorials Training Articles Interviews Career Advices Forums Codes Blogs Videos Jobs Community
News & Events | Tutorials >> ASP.NET, Silverlight, WPF, WWF, Dynamic Data, more ... | Downloads || Quick Links || Top Posts | Top Performers || .NET Feeds | Links ||
Subscribe | Search | Register

Online : 530 | Welcome, Guest! Login


Home > Interview Questions > .NET Framework Interview Questions

Interviews categories
.NET Framework ADO.NET AJAX Aptitude Test ASP.NET

BizTalk Server C# C SS Design Pattern and Architecture F#

HR HTML, DHTML IIS JavaScript jQuery


Advertisements
LINQ Networking OOPS Others PowerShell

Project Management Remoting, Web Services, XML, XSLT SharePoint Silverlight Software Testing - Quality Assurance

SQL Server VB.NET WC F WPF WWF

.NET Framework Interview Questions (301)

Submit | .NET Interview FAQs | Interview Home | Exclusive Interview Home | Search |
Now you don't need go anywhere to get the best interview questions on Microsoft technology. We are trying to gather all real interview
questions asked from MNC s and put them here. You can also assist us in doing so by submitting .net interview questions. These questions are
generally different from certification questions however it may help you in that too.

dotnetfunda.com/interview/ShowCatQuestion.aspx?… 1/10
2/21/2011 .NET Framework Interview questions Page 1

Difference between event and delegate?


P os ted by: D dd

event:

1) It is a data member of a type(class/structure)

2)It is declared inside a type(class/structure)

3) It is used to generate notifications which are then passed to methods though


delegates.

delegate:

1)It is a datatype(reference type) that holds references of methods with


some signatures.also called as function pointer.

2)It may or may not be declared inside a class.

3)It is used as the return type of an event and used in passing messages from event to methods.

event-->delegate-->method
example:
namespace dd
{
//delegate declaration
delegate void first();
class cc
{
//event declaration
public first myevent;
}
Job Vacancies in
}
TCS
Exp: 0 to 13 Yrs.Sal:
example 2:
25k to 95k PM Apply
Now & get Multiple button1.Click+=new EventHandler(this.button1_Click);
Interviews (Windows Applications)
Tim e sJobs.com /TC S

PDF Object for ASP Click is the event that returns an instance of the EventHandler delegate.
& .NET EventHandler delegate has the reference of button1_Click event and that
PDF Forms, PDF-to- helps in the communication betwen the Click event and button1_Click method
Image, security
HTML-to-PDF, Difference between a Class and Component?
stitching, barcodes. P os ted by: D dd
www.asppdf.com

Free C# Component Class is a datatype that encloses data and function members.
dotnetfunda.com/interview/ShowCatQuestion.aspx?… 2/10
2/21/2011 p .NET Framework Interview questions Page 1
Free .NET security It can be used for implementing the various OOPS features.
component for user Component is a particular class that must implement the IComponent interface .It is the base class for all components
mgmt and access in the common language runtime that marshal by reference. Component is remotable and derives from the
control. MarshalByRefObject class.
www.PortSight.com /Se cur… IComponent interface belongs to System.ComponentModel namespace.

Job Interview So, we can say Component is subclassification of a class


Questions
Hundreds of Job Difference between imperative and interrogative code.
Interview Questions P os ted by: D dd
Software, Sciences,
Engineering All
www.ALLinte rvie w.com Imperative code does not return a value. It just does performs an action.
example:
National IT Aptitude
Test c#
Make a Mark in Your void demo()
IT Career with {
National IT Aptitude Console.WriteLine("welcme");
Test.
NIITEducation.com /NITAT
}
Top Interview Leaders
vb.net
sub procedures are imperative code.
Mon, Feb, 21, 2011 Leaders sub dd()

Ddd (120) end sub


All Time Leaders
Interrogative code does return a value.
Tripati_tutu (10080)
c#
Ddd (7760)
ex: int add(int a)
{
C hvrsri (2640) return a*5;
PandianS (1360) }
Vpramodg (1160)
Prasham (1120) VB.NET FUNCTIONS
ex
How to become a Leader? function calc(byval a as integer) as integer
return a*5
end function

Bank of America Jobs 100s of New Openings Submit Resume to Apply Now MonsterIndia.com
SFTP components for .NET The fastest and the most powerful SFTP for VB.NET, C#, ASP.NET www.eldos.com/Secure
400+ Java/J2EE Q&A Java/J2EE interview FAQs answered with lots diagrams, examples & code www.lulu.com/java-succ

Which controls cannot be placed on an MDI Form?


P os ted by: D dd
dotnetfunda.com/interview/ShowCatQuestion.aspx?… 3/10
2/21/2011 P os ted by: D dd
.NET Framework Interview questions Page 1

These controls cannot be placed on the MDI Form

1)Components :

example: BackgroundWorker,
ImageList,
HelpProvider,
Timer

2)Printing:
example: PrintDocument, PrintDialog

3)Dialogs
example: ColorDialog,
SaveFileDialog

These controls are placed in the Component Tray window.


It is the window below the Form window anad can be viewed in Design mode
It contains all the controls which cannot be viewed even by default
when the application executes.

How can you specify the framework version targetted by your application?
P os ted by: D dd

In ASP.NET 4.0, we can write in web.config file like this:

A new attribute targetFramework has been added.

<?xml version="1.0"?>
<configuration>
<system.web>
<compilation targetFramework="4.0" />
</system.web>
</configuration>

What will be the output of this code? using System; class A { class B { public string str =
"welcome"; } } class Demo { static void Main() { B Obj = new B(); Console.WriteLine(Obj.str); } }
P os ted by: D dd

Answer:

The compiler will generate an error

The Type or Namespace 'B' could not be found.

It is because since B is the inner class, it is now private.


dotnetfunda.com/interview/ShowCatQuestion.aspx?… 4/10
2/21/2011 .NET Framework Interview questions Page 1

Solution:

1)we have to change the access modifier of B to internal/public

2)we have to give the full path of class B when creating the object

i.e. A.B obj=new A.B();


Then we can see the value of the field str in the output.

Difference between Environment.MachineName, SystemInformation.ComputerName and


Dns.GetHostName
P os ted by: D dd

Environment.MachineName :

Environment is a class defined by System Namespace.


MachineName is its property.

It reads the NetBIOS name of local computer..

SystemInformation.ComputerName :

SystemInformation is a class defined by System.Windows.Forms Namespace


ComputerName is its property,

output:
Same as Environment.MachineName

Dns.GetHostName :

Dns is a class defined by System.Net namespace:


GetHostName is its method.

It gets host name of computer which refers to a domain name that has one or more associated IP adresses.

Difference between String.Empty and ""


P os ted by: D dd

String.Empty is a readonly field, while "" is a constant


Consider this code snippet.

dotnetfunda.com/interview/ShowCatQuestion.aspx?… 5/10
2/21/2011 .NET Framework Interview questions Page 1

private void button1_Click(object sender, EventArgs e)

string s = textBox1.Text;

switch (s)

case String.Empty:

MessageBox.Show("blank");

break;

//Compiler will generate an error


//A constant value is expected

//So, if we use "" in place of String.Empty, no error will be generated.

Vehicle Network Interface Network interface specialists. Equipment for industry and OEMs www.AVT-HQ.com
dotnetfunda.com/interview/ShowCatQuestion.aspx?… 6/10
2/21/2011 .NET Framework Interview questions Page 1
Vehicle Network Interface Network interface specialists. Equipment for industry and OEMs Q co

Labcaire Systems Ltd Safety cabs,Free service offer on all cabinet purchase before Aug 10 www.puricore.com
Interview Questions .Net , J2EE , PHP (Job Openings) Asp.Net , C#.net , JSP , EJP , Java www.PrepareForJob.com/inde

Can abstract class have constructors?


P os ted by: D dd

Yes, an abstract class does have a constructor.


It will be called when it subclass is instantiated.

example:

abstract class bank

public bank()

Console.WriteLine("bank");

class icici : bank

icici()

Console.WriteLine("icici");

static void Main()

bank b = new icici();

dotnetfunda.com/interview/ShowCatQuestion.aspx?… 7/10
2/21/2011 .NET Framework Interview questions Page 1
}

//Output:

when the object of icici class is created,


They will be displayed in the output.
bank
icici

What is Serialization?
P os ted by: D dd

Serialization:

It is the process through which we can convert an object into a format that can be persisted or transported.
During this process, the public and private fields of the object and the name of the class,including the assembly
containing the class, are converted to a stream of bytes,
which is then written to a data stream.
Serialization allows us to save the state of objects from memory to files.
It is most commonly used in Web Services/Remoting applications.

Difference between Finalize and Dispose methods ?


P os ted by: D dd

Finalize and Dispose are both known as Finalizers.

dotnetfunda.com/interview/ShowCatQuestion.aspx?… 8/10
2/21/2011 .NET Framework Interview questions Page 1
They are the methods used to deallocate the memory of the objects
Differences:

FINALIZE

1)Finalize belongs to the Object class.

2)It is automatically called by the Garbage Collection mechanism when the object goes out of the scope(usually at the
end of the program)
It is not called by the User Code.

In C#, suppose there is a class known as emp

class emp
{
//This is the destructor of emp class
~emp()
{

}
//This destructor is implicitly compiled to the Finalize method.
}

3)Not suitable for instant disposing of the objects.Sloer method.

DISPOSE

1)Dispose belongs to the IDisposable interface

2)we have to manually write the code to implement it(User Code)


ex: if we have emp class we have to inherit it from the IDisposable interface
and write code. We may have to suppress the Finalize method using GC.SuppressFinalize() method.

3)Faster method for instant disposal of the objects

Example: user interface Controls. Forms, SqlConnection class have built in implementaion of Dispose method.

How many classes a dll can contain?


P os ted by: D dd

There is no limit.
However, it depends upon the hardware space available and the performance
related parameters.

Navigate to Page: 1 | 2 | 3 | 4 | 5 | 6 | ... | 26 |

M E l i
dotnetfunda.com/interview/ShowCatQuestion.aspx?… NET F kI t i Q ti h 9/10
2/21/2011 .NET Framework Interview questions Page 1
More Exclusive .NET Framework Interview Questions here
300+ .NET Interview preparation videos are here

Found interesting? Add this to:

| More | Bookmark It

About Us | C ontact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top

General Notice: If you found plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further
action.

C opyright © DotNetFunda.C om. All Rights Reserved. C opying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference
purposes and they may be respective owner's right or trademarks. | 2/21/2011 1:22:09 PM

dotnetfunda.com/interview/ShowCatQuestion.aspx?… 10/10

S-ar putea să vă placă și