+ 3

A little help here!!!

What the HECK is wrong with this code??? https://code.sololearn.com/cTKBS5P9n6TG/?ref=app

7th Dec 2017, 10:10 AM
Taabeer Murtaza
Taabeer Murtaza - avatar
5 Answers
+ 10
@Tabeer Murtaza: It's done using the Integer wrapper class, take this example: int x = 10; Integer y = new Integer(x); // This is an integer object now. System.out.print(y.equals(x));
8th Dec 2017, 10:14 AM
Dev
Dev - avatar
+ 11
yknow, errors are friends, not foes. try looking up what the error means online.
7th Dec 2017, 10:12 AM
Ahri Fox
Ahri Fox - avatar
+ 7
FYI, the equals() method doesn't work on integers (of course, because integers cannot be dereferenced). There's a way if you can create objects, have a look: https://stackoverflow.com/questions/13971523/integer-equals-method
7th Dec 2017, 10:37 AM
Dev
Dev - avatar
+ 4
Well I agree with you....
7th Dec 2017, 10:14 AM
Taabeer Murtaza
Taabeer Murtaza - avatar
+ 3
@Dev brother, link you provided confused me even more, probably because of alien English they used, can you please tell me how to create integer objects (in simple words).
8th Dec 2017, 7:24 AM
Taabeer Murtaza
Taabeer Murtaza - avatar