Instructions

  • 1. Your final score will reflect your grasp of the concepts—approach each question with precision.
  • 2. Thoroughly review each solution before proceeding to ensure full understanding.
  • 3. Final results will be available after submission to provide insights into areas for further improvement.
  • 4. Maintain academic integrity—plagiarism undermines learning and professional growth.
  • 5. Once submitted, responses are final, so ensure you’re confident in your answers.
  • 6. These challenges are designed to test practical knowledge; apply your skills as you would in real-world scenarios.

All Problems

Question

Action

What is method overloading?

View

Which type of polymorphism does method overriding implement?

View

Does Python support method overloading directly?

View

Which keyword is used to call the parent class method in overriding?

View

What happens if the subclass does not override a method from the parent class?

View

Which of the following is true about method overriding?

View

Which method in Python can be overridden to modify string representation?

View

What is the output of the following code?

View

Which method is called when an object is printed?

View

Can method overriding work without inheritance?

View

What is method overloading?

Defining multiple constructors
Defining multiple methods with the same name but different parameters
Redefining a parent class method in a subclass
Calling a method multiple times in a loop

Which type of polymorphism does method overriding implement?

Compile-time
Runtime
Static
Dynamic

Does Python support method overloading directly?

Yes
No
Only for static methods
Only in multiple inheritance

Which keyword is used to call the parent class method in overriding?

base()
parent()
super()
overload()

What happens if the subclass does not override a method from the parent class?

The subclass throws an error
The subclass uses the parent’s version
The method becomes abstract
The subclass inherits no methods

Which of the following is true about method overriding?

It occurs within the same class
It allows a subclass to provide a specific implementation
It requires private attributes
It is only used for class methods

Which method in Python can be overridden to modify string representation?

__str__()
__repr__()
__format__()
All of the above

What is the output of the following code?

class A: def show(self): print("Class A") class B(A): def show(self): print("Class B") obj = B() obj.show()

Class A
Class B
Error
None

Which method is called when an object is printed?

__repr__()
__print__()
__str__()
__display__()

Can method overriding work without inheritance?

Yes
No
Only with interfaces
Only with abstract classes