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 'Object references' - 4 question(s) found - Order By Newest | ||||
| ||||
Ans. "this" keyword is a reference to the current object and can be used for following - 1. Passing itself to another method. 2. Referring to the instance variable when local variable has the same name. 3. Calling another constructor in constructor chaining. | ||||
Sample Code for this keyword | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   this   object reference   constructor chaining intermediate   rare | ||||
Try 3 Question(s) Test | ||||
| ||||
Ans. FALSE. == operator compares object references, a and b are references to two different objects, hence the FALSE. .equals method is used to compare string object content. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  string   string class   java   ==   object references   coding Asked in 2 Companies basic   frequent | ||||
Try 1 Question(s) Test | ||||
| ||||
Ans. There can be two different elements with the same hashcode. When two elements have the same hashcode then Java uses the equals to further differentation. So there can be one or two objects depending on the content of the objects. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   hashcode   map   hashmap   object reference   advanced Asked in 1 Companies | ||||
| ||||
Ans. Null | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  object reference  null Asked in 1 Companies basic | ||||