Go to DotNetFunda.com
 Online : 1259 |  Welcome, Guest!   Login
 
Home > Interview Questions > C# Interview Questions

call for mock interview



C# Interview Questions (200)


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 MNCs 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.




C# is called Strongly Typed Language becausen its type rules are very strict. For example you can't called a function that is designed to call Integer with a string or decimal. If you want to do so then you will have to explicitly convert them to integer.

Since String is sealed class we can't create object for it.

ref parameter:
Ref is keyword.
it must be used along with actual and formal arguments.
ref variables must be initialized before passing to a function

out parameter:
It is very similar to call by Reference.
Out is a Keyword.
Which must be used along with actual and formal arguments.
Out variables are not require to initialize, the initialized value will not be passed, only reference will be passed.

Virtual keyword is used to declare a method inside the base class that can be overridden.

Following conditions are applied to a virtual method

1. Virtual method can not be declared as Private
2. Virtual method can not be declared as Static
3. Virtual method may or may not be overridden.
4. In order to override the virtual method of the base class, Override keyword is used provided the method signature of the derived class is same as base class, even the access modifier should be same.
5. A Virtual method must contain the method body otherwise compiler shall throw error.
6. Virtual keyword is only used in base and derived class scenario where you want your method over-ridable in the derived class.

Enjoy virtual keyword :)

IEnumerable<T>
IEnumerable<T> is best suitable for working with in-memory collection.
IEnumerable<T> doesn't move between items, it is forward only collection.

IQueryable<T>
IQueryable<T> best suits for remote data source, like a database or web service.
IQueryable<T> is a very powerful feature that enables a variety of interesting deferred execution scenarios (like paging and composition based queries).

So when you have to simply iterate through the in-memory collection, use IEnumerable<T>, if you need to do any manipulation with the collection like Dataset and other data sources, use IQueryable<T>.

Please let me know your feedback, if any

No, a class can not be declared as Protected.

A class can be declared with only following access modifiers.

Abstract
Internal
Public
Sealed
Static
Extern (The extern modifier is used to declare a method that is implemented externally. - http://msdn.microsoft.com/en-us/library/e59b22c5(VS.80).aspx)

Thanks

No, In C#, a derived class can’t be more accessible than it’s base class. It means that you can't inherit a private class into a public class. So always the base class should be more or equal accessible than a derived class.

// Following will throw compilation error
private class BaseClass

{
}
public class DerivedClass : BaseClass
{
}


// Following will compile without an error
public class BaseClass

{
}
public class DerivedClass : BaseClass
{
}


Hope this helps

NOTE: This is objective type question, Please click question title for correct answer.

System.Drawing.Graphics is the class used for dealing with graphics objects

1) FileIOPermission
2) UIPermission
3) SecurityPermission

We can directly read an image file and load it into a Bitmap object as below.
Bitmap myBmpObj = Bitmap.FromFile(strPath);


We can also set Image path during the Initilization of Bitmap Object. Code as given below.
Bitmap loBMP = new Bitmap(strPath);





Modified By:
Moderator3

Using Page.PreviousPage.FindControl() method.


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

 More Exclusive C# Interview Questions here


Advertisement

About Us | The Team | Advertise | Contact 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.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying 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. | 9/3/2010 3:41:51 AM