Is it mandatory to implement all methods of interface in the class which includes interface?
Answer Posted / Amit Prasad Singh
"Yes, when a class implements an interface in SAP ABAP (Object Oriented), it must provide its own implementation for every method defined in that interface. Failing to do so will result in a compilation error. Here's an example:nn```abapnINTERFACE if_example.n METHODS: method1,n method2.nENDINTERFACEnCLASS zcl_implementer IMPLEMENTATION OF if_example.n METHOD method1.n .n ENDMETHODn METHOD method2.n .n ENDMETHODn``` In the example above, zcl_implementer implements if_example and provides an implementation for both methods defined in the interface. "
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
No New Questions to Answer in this Category !! You can
Post New Questions
Answer Questions in Different Category