What does the term "method overriding" refer to in OOP?ओओपी में "विधि ओवरराइडिंग" शब्द क्या दर्शाता है?
Show answerHide answer
Correct answer: (B) Defining a method in a derived class with the same name as in the base classएक व्युत्पन्न वर्ग में एक विधि को उसी नाम के साथ परिभाषित करना जैसा कि आधार वर्ग में है।
Explanation
Method overriding means a subclass redefines a method that has the same name, parameters and return type as one in its superclass. Same-name methods within one class with different parameters is overloading.Method overriding का अर्थ है कि subclass उस method को दोबारा परिभाषित करती है जिसका नाम, parameters और return type उसकी superclass के method जैसा ही हो। एक ही class में अलग parameters वाले समान नाम के methods overloading हैं।