Type Here to Get Search Results !

In OOP, what is a "mixin"?

0

 In OOP, what is a "mixin"?

A) A class that can be instantiated.
B) A type of abstract class.
C) A class that provides methods to be used by other classes without being a superclass.
D) A type of interface.

Answer: C) A class that provides methods to be used by other classes without being a superclass.

Explanation: A mixin is a class that provides methods that can be used by other classes without being a direct ancestor of those classes. Mixins allow for code reuse and the addition of functionality to classes in a flexible way, often seen in languages that support multiple inheritance.

Post a Comment

0 Comments