[Bug] in code Playground | Sololearn: Learn to code for FREE!

+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

11 Answers

New Answer

+9

S.Adil πŸ‡¦πŸ‡« you are doing unnecessary boxing "new Integer(10)"'. you can simply pass the value. https://code.sololearn.com/ci49N3Eme9jl/?ref=app

+8

Kevin β˜… it's just System.out.println(" Compiled" ); 😁😁 why bounded types not working? πŸ€”

+8

Pβˆ†WAN Mβˆ†URYβˆ† I passed Integer type I know String occurring error but in Integer type code Playground showing Deprecated warnings πŸ˜”

+8

Pβˆ†WAN Mβˆ†URYβˆ† is Generics not accepting wrapper class values? πŸ€”

+8

S.Adil πŸ‡¦πŸ‡« i can guess you will understand Kevin β˜… link.

+7

BroFar Pβˆ†WAN Mβˆ†URYβˆ† MiKoLaπŸ”₯3L17.4L16.2.5k=>L18.πŸ™IDLE πŸ€”πŸ€”πŸ€”

+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.

+5

It has nothing to do with bounded type parameters. https://code.sololearn.com/cGWDdd5j7VtR/?ref=app

+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.

+3

It compiles: https://code.sololearn.com/cbyIyWwQbcc3/?ref=app But shows a warning.

+2

πŸ€”πŸ€”πŸ€”πŸ€”