I know that raw types are bad in code, and List<?>
and List
, for example, are different things. But what about situation with ResponseEntity<?>
and ResponseEntity
? Using in @RestController
.
ResponseEntity<?>
it's kinda trick for IDE, so it's not gonna say you have raw type in your code.
So they are actually absolutely the same, anyway I'd suggest you do not use raw type and provide generic types for any of you response entities.
They are actually the same, compiler would replace it with generic type, if you see here in the documentation ResponseEntity it's actually
class ResponseEntity<T>
so ResponseEntity<?>
and ResponseEntity
are the same.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With