Interview Questions and Answers - Order By Newest Q181. Which of the polymorphism type - static or runtime - is more important ? Core Java
Ans. Method overloading / static polymorphism compared to method overriding / runtime polymorphism has very limited usage as it just opens up an alternate way of defining a different method with the same name.
Method Overriding on other hand opens up many other features like contracting , interfacing , pluging development and hence development of libraries and frameworks. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  oops  oops features  oops concepts Q182. How to instantiate jsp variable from another jsp? JSP
Ans. using session attribute.
session.setAttribute("userId",userId);
in first jsp
int userId=session.getAttribute("userId");
in second jsp; Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q183. Find unique values between two arrays using single for loop ? Core Java
This question was recently asked at 'Net connect'.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  for loop  control statements  loop statement Asked in 1 Companies Q184. 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 Q185. 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 Q186. 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 Q187. 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 conceptsAns. Hadoop 1.x
It supports only MapReduce (MR) processing model.
It has limited scaling of nodes. Limited to 4000 nodes per cluster.
It has single Namenode to manage the entire namespace.
It has Single-Point-of-Failure (SPOF)
Works on concepts of slots – slots can run either a Map task or a Reduce task
MR has to do both processing and cluster resource management.
Hadoop 2.x
It supports MR as well as other distributed computing models like Spark, Hama, etc
It has better scalability. Scalable up to 10000 nodes per cluster.
Works on concepts of containers. Using containers can run generic tasks.
It has Multiple Namenode servers manage multiple namespace.
YARN does cluster resource management and processing is done using different processing models. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   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   Q190. 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 Q191. What are the static class members loaded into the memory ? OOP
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   Q192. Can we initialize final fields within the constructor ? Why ? Core Java
Ans. Yes, Because final fields needs to be initialized before the construction of the object completes. Not necessarily at the time of class loading. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  oops Q193. What is the relationship between Vehicle and Engine in this example ?
public class Vehicle {
Enginer engine;
public void move(){
engine = new Engine();
engine.start();
}
} Core Java
a. Composition ( Vehicle has a Engine ) b. Composition ( Engine has a Vehicle ) c. Inheritance ( Vehicle is a Engine ) d. Inheritance ( Engine is a Vehicle )Ans.a. Composition ( Vehicle has a Engine )
Q194. What is the relationship between Car and Vehicle in the following code ?
public class Car extends Vehicle{
Engine engine;
public static void main(String[] args){
Vehicle vehicle = new Car();
car.move();
}
public void move(){
engine = new Engine();
engine.start();
}
} Core Java
a. Composition ( Vehicle has a Car ) b. Composition ( Car has a Vehicle ) c. Inheritance ( Vehicle is a Car ) d. Inheritance ( Car is a Vehicle )Ans.d. Inheritance ( Car is a Vehicle )
Q195. What is the problem with the following code ?
public class Car extends Vehicle{
Vehicle vehicle;
Car(){
super();
this.vehicle = new Vehicle();
}
} Core Java
a. There is an Inheritance as well as Composition relationship between Vehicle and Car which is not permitted b. We cannot initialize the parent class instance within the constructor c. Call to super is illegal d. There is no problemAns.d. There is no problem
Q196. Which of the following Java feature specify hash-a relationship between objects ? Core Java
a. Inheritance b. Composition c. Polyorphism d. EncapsulationAns.b. Composition