Because Java cannot be multiple inherited in the first place, a class T cannot extend multiple classes, so even T specified in the generic should follow that principle.
Therefore, in the generics, one extends and one or more implements are combined
class Test<Textends ClassA&InterfaceB&InterfaceC>{
......
}
A format like this is possible (Note: Bound Type Parameters: Multiple Bounds), but there is no way to specify multiple classes.
© 2024 OneMinuteCode. All rights reserved.