Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,195,602 members, 7,958,843 topics. Date: Thursday, 26 September 2024 at 05:11 AM |
Nairaland Forum / Science/Technology / Programming / JAVA Gurus, Check This Little Code!!!! (1397 Views)
Java Gurus Please I Need This Little Assignment Solved ''appreciation Involved" / Java Gurus Help / Excuze Me .... Java Gurus.. Dnt Pass By. (2) (3) (4)
JAVA Gurus, Check This Little Code!!!! by Aphatech: 12:43pm On Apr 02, 2016 |
Integer a=100, b=100; System.out.printIn(a == b); Integer c=200, d=200; System.out.printIn(c == d); . . . The use second command print false, why? Let's see how good you are to detect small error!!! |
Re: JAVA Gurus, Check This Little Code!!!! by APHATHEOLOGY(m): 2:01pm On Apr 02, 2016 |
Where are the JAVA daemons? |
Re: JAVA Gurus, Check This Little Code!!!! by Nobody: 3:09pm On Apr 02, 2016 |
Integer a=200, b=200;this will give you false as well. int a=200, b=200;this will give you true. Integer a=100, b=100;this will return true in all cases int a=100, b=100;this will return true in all cases Reason: you cannot compare 2 integers the same way you will compare int (they are 2 different things entirely). I ain't got time to teach now o jare. 1 Like |
Re: JAVA Gurus, Check This Little Code!!!! by Fulaman198(m): 3:55pm On Apr 02, 2016 |
dhtml18: To expand upon this, when you declare Integer a = 100; you are creating an instance of Object Integer. To check for object content equality, the .equals() method should suffice. The reason why Integer a = 100, b = 100; and (a == b) comes out to false is because they are not pointing or referencing to the same object. 2 Likes |
Re: JAVA Gurus, Check This Little Code!!!! by Nobody: 5:28pm On Apr 02, 2016 |
Just passing by with my 'java bible' text book firmly held in my armpit. 1 Like |
Re: JAVA Gurus, Check This Little Code!!!! by Fulaman198(m): 7:10pm On Apr 02, 2016 |
crotonite: lol 1 Like |
(1) (Reply)
Need Someone That Can Help Code And Do Writeup For Final Year Project / Vacancy - PHP Application Developer / Who Has Books On Python Programming Hard Copy For Sale
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 9 |