Unknown model· unknown
from ShareGPT 90K (shared ChatGPT conversations)
abstract function, do you have to write code in it when it is in abstract?
Private research annotation
Sign in to add a private research label or note.
- User
abstract function, do you have to write code in it when it is in abstract?
- Assistant
No, when you define a function as abstract in a class or interface, you do not provide the implementation code for that function in that class or interface.
Instead, the responsibility of providing the implementation code for an abstract function lies with any concrete subclass that inherits from that class or implements that interface.
So, the purpose of abstract functions is to define a contract or a blueprint for a function that must be implemented by any concrete subclass, but not to provide the implementation code for that function.