interviews.dotnetthread.com

↑ Grab this Headline Animator

Thursday, July 15, 2010

WebMatrix - Microsoft new IDE (Free Tool)

Have a look at WebMatrix a new IDE for Web Development. (Simplifies Web development)
http://www.microsoft.com/web/webmatrix

Introduction and First application.
http://weblogs.asp.net/scottgu/archive/2010/07/06/introducing-webmatrix.aspx

Simple IDE for website development uses inbuilt lightweight file based database and the new cshtml is amazing (similar to Coldfusion).
- SQL Server Compact Edition
- Cshtml (ASP.NET Razor)
- IIS Express with all required developer features.
- Web Server
- Open source application gallery (Web Apps)

Submit this story to DotNetKicks

Microsoft Jobs

1. SR Software Development Engineer

SQL 2005/2008
.NET Framework 3.5/4.0
ASP.NET/ASP/C#
WCF/WPF/WF/Silverlight
SharePoint 2007/2010


Apply Now: http://www.jobthread.com/jt/jobs/widget_click.php?id=85794d&job_id=541131

2. Software Development Engineer (SDE)

and formulate recommendations clearly. Technical horsepower and critical thinking are required.
6+ years of software development experience with C#, Silverlight, .Net programming, WCF Web services , SQL and VSTF 2008\2010.

Apply Now: http://www.jobthread.com/jt/jobs/widget_click.php?id=85794d&job_id=541135

Submit this story to DotNetKicks

Friday, April 9, 2010

What is Method Hiding?

Method hiding is to hide/mask method in base class by creating a similar function in derived class and by using new keyword in the derived class.
Unlike Method overriding, When we refer base class object created by casting derived class object a method in base class will be called.
Also we can change the return type while masking the base class method.
Using new keyword is not compulsory, however a warning will be displayed if we wont specify new keyword while masking.


Example:

Base Class:
--------------
public class BaseClass
{
public virtual void Method1()
{
Print("Base Class Method");
}
}

Derived class
---------------
public class DerivedClass: BaseClass
{
public override void Method1()
{
Print("Derived Class Method");
}
}

Usage
-------------------
public class Sample
{
public void TestMethod()
{
DerivedClass objDC = new DerivedClass();
objDC.Method1();
BaseClass objBC = (BaseClass)objDC;
objDC.Method1();
}
}
Result
-----------------------------------
Derived Class Method
Base Class Method

Submit this story to DotNetKicks

Difference Between Function Overloading and Overriding ?

Overloading means having functions with the same name but with different signature.Signature includes method name and Parameters. These functions can be part of base class or derived class.

Whereas Overriding means changing the functionality of a method without changing the signature. We can override a funtion in base class by creating a similar function in derived class and by use virtual/override keywords.

Base class method has to be marked with virtual keyword and we can override it in derived class using override keyword.

Derived class method will completly overrides base class method i.e when we refer base class object created by casting derived class object a method in derived class will be called.

Example:

Base Class:
-------------------------------
public class BaseClass
{
public virtual void Method1()
{
Print("Base Class Method");
}
}

Derived class
---------------
public class DerivedClass: BaseClass
{
public override void Method1()
{
Print("Derived Class Method");
}
}

Usage
--------------------------
public class Sample
{
public void TestMethod()
{
DerivedClass objDC = new DerivedClass();
objDC.Method1();
BaseClass objBC = (BaseClass)objDC;
objDC.Method1();
}
}

Result
---------------------
Derived Class Method
Derived Class Method

Submit this story to DotNetKicks

What is the difference between int.Parse and int.TryParse methods?

int.Parse is a simple method used to convert string to integer. It throws exception when null or invalid input is provided. Hence it is slow.

int.TryParse does not thow any exception instead we must describe second parameter as out parameter which holds result. And it returns boolean value representing success or failure.

Submit this story to DotNetKicks

What is the difference between System.Text.StringBuilder and System.String?

String is immutable and string builder is mutable.
String is useful as some costly operations for copying and comparing can be omitted making program simple.

However, making an object immutable is usually inappropriate if the object contains a large amount of changeable data.

So String is not suggested to hold huge data as replacements or concatinations will be costly and time consuming.

Copying is simple using reference. Whereas reference copying technique (Copying data without pointing to the same reference) is difficult in case of StringBuilder.

String will allocate only what is needed. When we concatinate strings, it sums up the length of all and creates buffer to fit that.

Whereas string builder allocates capacity of 16 initially and increases capacity in the multiples of 2.

Submit this story to DotNetKicks

 

Latest Articles