Interview Questions and Answers - Order By Newest This question was recently asked at 'MST Solutions'.This question is still unanswered. Can you please provide an answer. Sample Code for composition Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  composition  object oriented programming (oops)  oops concepts  oops concepts Asked in 1 Companies basic   frequent Q92. What are the drawbacks of creating immutable objects ? Why don't we create all object immutable if mutability possesses so much threat ? Core Java
Ans. Immutable objects relieves us from the problems of inconsistencies and security and helps with better read performance but at the same time are write performance and storage overheads. In case any modification is required , a new object is created and thus creating multiple copies of it.
This is the reason we use StringBuffer / StringBuilder when we have to append some text multiple times and then create a String out of it. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  immutable  immutability objects  immutability Q93. Does immutability facilitates better performance ? Core Java
Ans. Yes , but only the read performance in case we don't need to modify it much. In case we need to modify it a lot , it creates write performance overheads as we would need to create many news objects instead of just changing one. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  immutable  immutability objects  immutability Q94. What is immutability and What are it's disadvantages ? Design
This question was recently asked at 'Bloomberg'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  immutable  immutability objects   immutability Asked in 1 Companies Q95. What is virtual table with respect to method overriding in Java ? Core Java
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  vtable  virtual method table   method overriding  runtime polymorphism  object oriented programming (oops)  oops concepts Q96. How is the virtual method table implemented in Java? Core Java
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  virtual method table   method overriding  runtime polymorphism  object oriented programming (oops)  oops concepts expert   rare Q97. How many VTables are there for each class ? Core Java
Ans. There is one VTable for each class. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  virtual table method  vtable  runtime polymorphism  object oriented programming (oops)  oops concepts   method overriding intermediate   rare Q98. Have you ever used java.util.Objects class ? Core Java
Ans. Yes, We are using requireNonNull method for validating if the object is null. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  objects  util methods   rare Q99. Can a class extend itself in Java ? Core Java
Ans. No Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  inheritance  object oriented programming (oops)  oops concepts Q100. How Object-Oriented Programming is implemented in JavaScript? How they differ from other languages? Javascript
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  object oriented programming in javascript  oops in javascript Q101. What will be the output of following ?
String str1 = new String("String1");
String str2 = new String("String1");
System.out.print(str1 == str2);
System.out.print(str1.equals(str2));
str1 = str2;
System.out.print(str1 == str2); Core Java
a. falsetruetrue b. truetruetrue c. truetruefalse d. falsetruefalseAns.a. falsetruetrue
Q102. What will be the output of following code ?
String str1 = "String1";
String str2 = "String1";
System.out.print(str1 == str2);
System.out.print(str1.equals(str2));
str1 = str2;
System.out.print(str1 == str2); Core Java
a. falsetruetrue b. falsefalsetrue c. truetruetrue d. falsefalsefalseAns.c. truetruetrue
Q103. Which of following is not the method of object class ? Core Java
a. run b. notify c. wait d. cloneAns.a. run