Lesson 29 of 34
Polymorphism, Abstract Classes మరియు Interfaces
11 min 35 XP
Abstract class కు objects సృష్టించలేరు; child classes దాని abstract methods ను రాయాలి. Interface ఒక ఒప్పందం: దాన్ని implement చేసే class దాని అన్ని methods రాయాలి, ఒక class అనేక interfaces ను implement చేయవచ్చు.
Example: edit me and press Run
Press Run to see the result here.Example: edit me and press Run
Press Run to see the result here.Shape s = new Circle(...) అనేది runtime polymorphism: variable type Shape, కానీ Circle యొక్క area() నడుస్తుంది. Overriding runtime polymorphism; overloading compile-time.