Search Interview Questions | ![]() ![]() Click here and help us by providing the answer. ![]() Click Correct / Improve and please let us know. |
|
| ||||
Interview Questions and Answers | ||||
| ||||
Ans. When we create reference for primitive type, it's memory is allocated. So even if we don't assign any value to it, the default value is initialized. int x; // default value 0 initialized But for object references, it's different as references hold nothing till an object is assigned. Object obj; // contains null So all primitive types when declared , contains their respective default values on the basis of their type whereas all wrapper class References contains null irrespective of their types. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||