RE: What is the difference between Abstract class and ...
In design you want the base class to present only an interface for its derived classes. This means you don t want anyone to actually instantiate an object of the base class. You only want to upcast to it so that its interface can be used. This is accomplished by making that class abstract using the abstract keyword. If anyone tries to make an object of an abstract class the compiler prevents it. The interface keyword takes this concept of an abstract class a step further by preventing any method or function implementation at all. You can only declare a method or function but not provide the implementation. The class which is implementing the interface should provide the actual implementation.
RE: What is the difference between Abstract class and ...
You have given difference for the above question such as Abstract class does not support Multiple Inheritance. Interface supports Multiple Inheriatnce . Can you provide me an example for this difference. If possible give me an real time example
The main differece is Abstraction: In this we can identify the specific properties and attributes of a pertricular class. and exposing the data to the user .......... example: A car we can know or see that what it look lies in color in the restpect to body of car but we can not know the fearchers they are using into the car
Encapsulation: Binding the data and functions into the single unit. i.e in the other way u can say that hiding the details from the others..
example : same Car in which we can see how the car is but when it is not working in that case i can not repaire it b'coz all the details of repairing are hidden from me ...
RE: What is the difference between Abstract class and Interface
Ok this is one of the common interview questions. Let me put this in simple words
when you use Interface : There can be different classes which show different behaviour. Like consider a case I want to put all animals in a tree structure. I have top most defination as Animal then we have birds reptiles mammals etc.. Now all these have different features from each other yet they show some common features like they move they eat food ... so i will use Animal as interface and define those features in the class that implements it.
when you use abstract class: when i want to show a is-a type of realtion. now lets go further with the same example now I want to further classify my birds as those which can fly and those that cann't fly.. now this is specific to the birds in here i will go with abstract class.