05-02-2011, 06:33 AM
in abstract classes where abject donot extensiate,why we make concrete classes in it?
|
in abstract classes where abject donot extensiate,why we make concrete classes in it?
|
|
05-02-2011, 06:33 AM
in abstract classes where abject donot extensiate,why we make concrete classes in it?
05-02-2011, 06:33 AM
I think you are familiar with the concept of Abstract class and Concrete class. As you know very well its OOP who thinks every thing in terms of objects and defines relationship as we see and think in the real world.
Lets explain your question with an example, Shape and Triangle are two classes, as it is seen in the real world that Triangle is a kind of shape........ So, we declare in OOP Shape as a base class and Triangle as derived. Secondly, it is also in your observation that shape itself is an abstract concept rather than a physical thing like Triangle, Square etc. So, this real world concept should be implemented while in coding. This can be implemented by using the concept of Abstract and Concrete class. Shape can be placed as an Abstract class and Triangle is its concrete class( derived also). However, the main purpose to declare and implement all these is to minimize complexity and map the real world concepts with OOP concepts. 0300-9520262 Get solution in 24 hour |cpmputer & internet mileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
|
|
« Next Oldest | Next Newest »
|