+ 1

Why wild arguments don't work?

In forEvery method definition, If i remove Function<Integer, Integer> by, Function<?,? > or Function<? extends Number,? extends Number> it shows error. why? https://code.sololearn.com/cBr6EHBfu1v4/?ref=app

26th Jul 2021, 3:57 AM
Jawahirullah
Jawahirullah - avatar
1 Réponse
+ 3
The first type parameter must be Integer since you call it on an Integer value in your code. However you can replace the second one with ? extends Number
26th Jul 2021, 5:57 AM
Hape
Hape - avatar