I have little bit confusion about oops concept.... In oops ,we have 4 features,
1.Abstraction
2.Encapsulation
3.Inheritance
4.Polymorphism
The above 4 features are 4 fillers to the object oriented programming.
--->Is there any difference between Abstraction and Abstract classes,if yes then What is the difference between Abstraction and Abstract classes.
--->Is there any chance to differentiate Abstraction Vs Inheritance??
Main advantage of Inheritance is 'Reusability' as well as we can use Abstraction for the same purpose
Can any one clear my confusion??
Nishant MittalPosted Nov 9, 2015, 6:13 AM
Mukesh KumarPosted Nov 9, 2015, 2:31 AM
AbstractionandInheritanceare the important features having wide implications inObject Oriented Programming. The full features may not be covered exhaustively in a short answer, and these are dealt elaborately in various books and articles. However, to get a quick idea they can described as below:Abstractionfrom Object Oriented Programming perspective is extracting the core features of an object to deal without being specific about the implementation details. For example if we take a vehicle then it can be abstracted like a an object havingWheels, Seats, Gearsamong other things, which can be treated as the members of aVehicleclass describing its composition. To add behaviour to the Vehicle there can be methods likeGiveHorn, Drive, ChangeGear, ApplyBrakeetc.Then specific classes can be derived from this base class using
Inheritance. Saya Car, a Bus. Soa Caris a vehicle with 4 wheels, 4 gears and say 4 seats. TheDrive, Change Gear, Apply brakecan be implemented within this derived class either afresh or they can used as provided in the base class or with a combination as per the requirement. Similarly a Bus is derived from the Vehicle class using inheritance and it has 6 wheels, 20 seats, 5 gears. The methods can be implemented as explained above.Mukesh KumarPosted Nov 9, 2015, 2:28 AM
Are you sure,
Unlike an Interface it can contain concrete things and in this case it is even very hot.
Hope this will help you.creig leePosted Nov 9, 2015, 2:09 AM
Pranay RanaPosted Jul 24, 2015, 9:10 AM
Pranay RanaPosted Jul 24, 2015, 8:49 AM
Pranay RanaPosted Jul 24, 2015, 8:34 AM
Rajeesh MenothPosted Jul 24, 2015, 8:19 AM