"Prefer composition over inheritance" is actually a well-known mantra and appears in, for example, the Design Patterns book from 1994, which is basically the OOP bible. And this is within the OOP bubble, you won't even find inheritance outside of it.
https://en.wikipedia.org/wiki/Design_Patterns
Don't take undergraduate OOP courses seriously.