I am learning now for some test, and I like to share with my obeservations
Let's start with some example class.
How do you think, what will be the ouput?
Let's start with some example class.
Suprised? Now you are wondering but how this is possible? Tests 2 tells me that the objects are equal and they have same value, but why this is not the same with Test 1? This is because two instances of the following warpper objects (created via boxing) will be always equal(in meaning ==) when their primitive are equals! Integer in range between -127...128 is a Short, so in first test we were out of the range short, and condition (a==b) failed.Equals values -test 1The same object! - test 2Equals values - test 2
Brak komentarzy:
Prześlij komentarz