Search Interview Questions | More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know. |
|
| ||||
Core Java - Interview Questions and Answers for 'Integer' - 6 question(s) found - Order By Rating | ||||
| ||||
Ans. It's of Integer objects and not primitive int. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  integer constant pool | ||||
| ||||
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. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  string pool  integer constant pool  string comparison  integer comparison | ||||
| ||||
Ans. It uses those low order bytes of the result that can fit into the size of the type allowed by the operation. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  integer  data types Asked in 1 Companies   rare | ||||
| ||||
Ans. 6 | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   int   integer   scjp   ocjp | ||||
| ||||
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. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   code   coding   set   treeset   string   integer | ||||
| ||||
Ans. http://www.buggybread.com/2015/01/java-data-types-integer-classes-and.html | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   data types   integer | ||||