Showing posts with label oops interview questions. Show all posts
Showing posts with label oops interview questions. Show all posts

Tuesday, March 29, 2011

.NET interview questions: - What are the different principle of OOPS?

Answer:
Different principles of OOPS are Abstraction, Encapsulation, Polymorphism and Inheritance.
1. Abstraction:- It is a thought process which show only the necessary properties.
2. Encapsulation:- Hiding complexity of a class.
3. Inheritance:- Defining a Parent-Child Relationship.
4. Polymorphism:- Object Changes it's behaviour according to the situation.
Regards,
Please click here to see .NET and C# interview questions and answers

Thursday, February 17, 2011

.NET and OOP interview questions :- What is the difference between abstraction and encapsulation ?

.NET and OOP interview questions :- What is the difference between abstraction and encapsulation ?


Answer:
This is a very typical .NET interview question which confuses most of the .NET professionals. Both abstraction and encapsulation look similiar , but they have huge differences between them.
Abstraction is nothing but simplifying objects while encapsulation is hiding complexity.

Encapsulation implements abstraction. Abstraction is a thought process which happens during planning phase. While encapsulation implements abstraction by using access modifiers ( private, public, protected, internal and protected internal).



Get the 500 .NET Interview questions and answers

Wednesday, December 1, 2010

C# and .NET OOP (Object oriented  programming) interview questions - Abstract classes and interfaces.


C# and .NET OOP (Object oriented programming) interview questions
-
Abstract classes and interfaces.


I have yet to remember a .NET interviewer who never asked about abstract classes, interfaces and object oriented interview questions . I am putting forward questions which comes around abstract classes and interfaces again and again...Hope every one benefits.
Normally the C# interviewer starts with.....

What is abstract class ?
Abstract class is a base class or a parent class. Abstract classes can have empty abstract methods or it can have implemented methods which can be overridden by child classes.

The next question i expected
was on interfaces and yes there it comes.


What are interfaces?
Interface is a contract class with empty methods , properties and functions. Any class which implements the interface has to compulsory implement all the empty methods , functions and properties of the interface.
Now the 1000% sure
question was bound to come difference between them...



What's the difference between abstract class and interface?
There are many differences, below are some key two differences :-

  • Abstract class are base class or parent class while interfaces are
    contracts.

  • Abstract class can have some implemented methods and functions while
    interfaces methods and functions are completely empty.

  • Abstract classes are inherited while interfaces are implemented.

  • Abstract classes are used when we want to increase reusability in
    inheritance while interfaces are used to force a contract.

Can we create a object of abstract class or interface?
No we can not.
Now the practical
question..


In what scenarios will you use a abstract class and in what scenarios will
you use a interface?

If you want to increase reusability in inheritance then abstract classes are
good. If you want implement or force some methods across classes must be for
uniformity you can use a interface. So to increase reusability via inheritance
use abstract class as it is nothing but a base class and to force methods use
interfaces.
Really friends having C# experience is one thing and cracking
Dot net and C# interviews is a different ball game all together .

Sunday, October 14, 2007

New ideas and ventures.....Planning 2010

Had a meeting with my internal team. We have planned to create a series of book in Hindi language till 2010. Here are some topics

-- OOPs Programming Hindi Mein ( OOPS Programming in Hindi Language)
-- C# Hindi Mein
-- Java Hindi Mein
-- Games programming Hindi mein
We are all set market , studied the market for 2 months and looks like we are all set to conquere the IT industry.

Which means i will have to put all my profit back as investment for this new thought....And i am ready for it.