Tuesday, February 10, 2009

C# InterviewQuestions- Part 1

Interview Questions
------------------------

1. What are the main properties of object oriented programming?
a ) There are mainly 3 properties
1. Encapsulation/Abstraction
2. Inheritance
3. Polymorphism

2. What is encapsulation?
a ) This gives a way to hide the internal details of an object from its users.

3. What is inheritance ?
a ) It provides a way to build/create new classes using existing classes.

4. What is polymorphism?
a ) It provides a way to take more than one form.

5. What is a constructor?
a ) Constructor enables an object to initialize itself when it is first created.

6. What are the properties of a constructor?
a ) They are
1. They should have the same name as that of a class
2. They do not specify a return type.
3. we can use access modifiers to constructor.

7. How many types of access modifiers are there ?
a ) 5 types
1. Private
2. Public
3. Protected
4. Internal
5. Protected Internal

8. What access modifiers we can use for a class?
a ) We can use 2 access modifiers
1. Public
2. Internal

9. What is the default access modifier of a class?
a ) It is Internal

10. What is the default access modifier for class members?
a ) It is Private

5 comments:

Topher said...

the stuff is a little over my head right now but I really want to learn. I have some ideas for iPhone ideas so I need to learn Cocoa and so forth.

Thanks

Vinay Rai said...

Nice Questions can you post some of the questions asked during interviews for C++ and Java

sherry_yao said...

Dropping by. It's a great blog. Keep on smiling for you!!

Jim said...

Good Keep the helping spirit up for us.

Srikanth said...

I really appreciate your work. Please keep up the work, cause it is so much helpful for the freshers in the field of .Net..