Search Interview Questions | ![]() ![]() Click here and help us by providing the answer. ![]() Click Correct / Improve and please let us know. |
|
| ||||
Core Java - Interview Questions and Answers for 'Integer' - 6 question(s) found - Order By Newest | ||||
| ||||
Ans. 6 | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. 1 111 2 TreeSet maintains the elements in the ascending order which is identified by the compareTo method. compareTo method in String has been defined such that it results in the natural alphabetic Order. Here the elements in the TreeSet are of String and not of Integer. In String Natural Order, 111 comes before 2 as ascii of 1st character first determines the order. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. http://www.buggybread.com/2015/01/java-data-types-integer-classes-and.html | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. It uses those low order bytes of the result that can fit into the size of the type allowed by the operation. | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() | ||||
| ||||
Ans. true false true Just like Strings, java maintains an integer constant pool too. So 1 will be maintained in integer constant pool and hence reference int2 will point to same integer in pool. String pool is only for string literals ( defined by "" ) and not for newly created objects and hence str1 == str2 will return false as they are separate objects in memory. String pool is used for storing string literals so that they can be reused and str3 and str4 will point to same string literal in string pool. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. It's of Integer objects and not primitive int. | ||||
![]() | ||||
![]() ![]() ![]() | ||||