[Bug] in code Playground | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 16

[Bug] in code Playground

I'm trying to compile this Java code but compiler says : "./Playground/Program.java uses or ovveride Deprecated APIs". why it's not complies? šŸ¤” https://code.sololearn.com/cLJy1LwBIqNh/?ref=app

24th Jul 2020, 4:19 AM
Shahghasi Adil
Shahghasi Adil - avatar
12 Respostas
+ 9
S.Adil šŸ‡¦šŸ‡« you are doing unnecessary boxing "new Integer(10)"'. you can simply pass the value. https://code.sololearn.com/ci49N3Eme9jl/?ref=app
24th Jul 2020, 5:14 AM
Pāˆ†WAN Māˆ†URYāˆ†
Pāˆ†WAN Māˆ†URYāˆ† - avatar
+ 8
Kevin ā˜… it's just System.out.println(" Compiled" ); šŸ˜šŸ˜ why bounded types not working? šŸ¤”
24th Jul 2020, 4:56 AM
Shahghasi Adil
Shahghasi Adil - avatar
+ 8
Pāˆ†WAN Māˆ†URYāˆ† I passed Integer type I know String occurring error but in Integer type code Playground showing Deprecated warnings šŸ˜”
24th Jul 2020, 5:05 AM
Shahghasi Adil
Shahghasi Adil - avatar
+ 8
Pāˆ†WAN Māˆ†URYāˆ† is Generics not accepting wrapper class values? šŸ¤”
24th Jul 2020, 5:18 AM
Shahghasi Adil
Shahghasi Adil - avatar
+ 8
S.Adil šŸ‡¦šŸ‡« i can guess you will understand Kevin ā˜… link.
24th Jul 2020, 5:25 AM
Pāˆ†WAN Māˆ†URYāˆ†
Pāˆ†WAN Māˆ†URYāˆ† - avatar
24th Jul 2020, 4:36 AM
Shahghasi Adil
Shahghasi Adil - avatar
+ 6
Hey S.Adil šŸ‡¦šŸ‡« . Bounded type will not work because you are passing the string object. And String class not extended the Number class. If you use bouded type parameter. Make sure your passed argument extended the Bounded parameter.
24th Jul 2020, 5:02 AM
Pāˆ†WAN Māˆ†URYāˆ†
Pāˆ†WAN Māˆ†URYāˆ† - avatar
+ 5
It has nothing to do with bounded type parameters. https://code.sololearn.com/cGWDdd5j7VtR/?ref=app
24th Jul 2020, 5:11 AM
Kevin ā˜…
+ 4
S.Adil šŸ‡¦šŸ‡« https://stackoverflow.com/questions/49904830/create-a-new-integer-object-that-holds-the-value-1 They can but you are wrapping the wrong way. new Integer() seems to be deprecated.
24th Jul 2020, 5:20 AM
Kevin ā˜…
+ 3
It compiles: https://code.sololearn.com/cbyIyWwQbcc3/?ref=app But shows a warning.
24th Jul 2020, 4:53 AM
Kevin ā˜…
+ 2
šŸ¤”šŸ¤”šŸ¤”šŸ¤”
24th Jul 2020, 4:39 AM
Mohammad Yasin Mohammadi
Mohammad Yasin Mohammadi - avatar
0
How can. Move. The blog
26th Feb 2022, 10:15 PM
Justin Eze