Lesson 29 of 34
Polymorphism, Abstract Classes এবং Interfaces
11 min 35 XP
Abstract class-এর object তৈরি করা যায় না; child classes-কে তার abstract methods লিখতে হয়। Interface একটি চুক্তি: যে class একে implement করে তাকে সব 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।