Originally posted by yekkala krishna:
but i want to know when we will use abstract and interfaces in our real time project.
Of course there's not an exact and precise rule...much it's up to designers' choices..
I can give you my "rules of a thumb":
Usually, after a refactor, when grouping common code in a new "ancestor class" you come up with a class you cannot associate to a precise logical entity and therefore you want to inhibit people from instantiating itWhen "ancestor class" code needs to call methods which have implementations which have absolutely to be defined in the extending class. Marking a method as abstract make the implementor more conscious of what they MUST do than simply defining a default implementation which CAN then be overridden