| |
GeekInterview.com > Interview Questions > J2EE > Java
| Print | |
Question: What is the difference between Abstract class and Interface
Answer: Answered by Scott on 2005-05-12 10:03:06: An abstract class can contain non-abstract methods which do not have to be overridden in the subclass. There is no difference between a fully abstract class (all methods declared as abstract and all fields are public static final) and an interface. |
| September 09, 2007 15:22:57 |
#17 |
| Sandip mple: |
Member Since: Visitor Total Comments: N/A |
Abtraction and Encapsulation |
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 ... |
| |
Back To Question | |