Interview questions in csharp


What is BOXING and UNBOXING in C#? In how many ways you can create new copies of an existing string in C#? In how many ways you can compare two strings in C# using overloaded methods and operators?

What is BOXING and UNBOXING in C#?
BOXING in C# is the conversion of a VALUE type on stack to a OBJECT type on the heap. Vice-versa the conversion from an OBJECT type back to a VALUE type is known as UNBOXING and it requires type casting.


In how many ways you can create new copies of an existing string in C#?
There are two ways:
1. Using overloaded = operator like - string s2 = s1;
2. Using the static Copy method like - string s2 = string.Copy(s1);

In how many ways you can compare two strings in C# using overloaded methods and operators?
There are three ways:
1. Overloaded Compare() method
2. Overloaded Equal() method
3. Overloaded == operator.



What is Process?
Anything under execution.

What is thread?
It is a process which executes independently.

Can interface have static member? Yes or No?
No.

By default the member of the interface are public and abstract.------True

How do I launch Internet Explorer in C#?
using the statement - System.Diagnostics.Process.Start("IExplore.exe",http://www.faqpanel.com);

Static Indexer are not allowed inC#


What is type safety?
Type safety is about increasing the opportunities for the compiler to detect your coding errors. If you use interfaces instead of delegates the compiler will have more opportunities to detect your coding errors.

What is Namespace?
-- a namespace is a logical
-- way of organizing related calsses and other types

What are partial classes?
The partial keyword allows the class, struct, or interface to span across multiple files

No, constructors are not inherited in c#

Difference between Convert.ToInt32(string) and Int32.Parse(string)?
The two give identical results, except where the string is null.
Convert.ToInt32(null) returns zero,
Int32.Parse(null) throws an ArgumentNullException.


Comments

Author: Prachi Kulkarni10 Apr 2012 Member Level: Gold   Points : 0

Hi,
Thanks for sharing the good one..

Regards,
Prachi.

Guest Author: Arun17 Apr 2012

HI Prachi Kulkarni Really thanks for sharing this

Regards
Arun

Guest Author: Arun17 Apr 2012

Hey Prachi sorry that post was for Rajeesh



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: