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.