Interview Questions and Answers - Order By Newest Q2201. Design an inventory management system. Design
This question was recently asked at 'verifone'.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   Asked in 1 Companies Q2202. What is micro-benchmarking in Java? Design
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   Q2203. How to Create Cron Job in Hybris e-commerce suite Hybris
This question was recently asked at 'Patni Computer Systems,IGate'.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   Asked in 2 Companies Q2204. What is the need for filters in Java Servlets ? Java EE
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   Q2205. What is the difference between Interfaces and Abstract Classes with respect to Java 8 ? 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   Q2206. Which of the OOP's feature - encapsulation or abstraction - is more important ? Core Java
Ans. Encapsulation facilitates security by hiding data and logic whereas Abstraction simplifies organization of data and related logic.
As applications scale, both concepts are required for easy management and maintenance. Encapsulation for security and criss cross communication between objects / modules will make it vulnerable. and Abstraction for better organization that enables better understanding of application code and easy maintainability. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  oops  oops features  oops concepts Q2207. 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 Q2208. What is the reason that non-static method are not allowed to be referenced from a static context in Java?
Core Java
Ans. If we try to access an instance method from a static context , the compiler has no way to guess which instance method ( variable for which object ), you are referring to. Though, you can always access it using an object reference. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q2209. Which are the thread safe / synchronized / concurrent classes in java collections ? Core Java
Ans. Stack
Properties
Vector
BlockingQueue
ConcurrentMap
ConcurrentNavigableMap Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  collections  concurrent classes Q2210. What are the differences between Intermediate and Terminal Operations in Java 8 streams? 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   Q2211. What is the difference between Collections.emptyList() and creating instance of a list ? 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   Q2212. Which are the classes that implement java.util.List interface ? Core Java
Ans. ArrayList
LinkedList
Vector
Stack Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q2213. Why do you think that Stack collection class implement List interface ? 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   Q2214. What is the there only one method declared in Runnable interface? Core Java
Ans. The Runnable interface describes a class whose instances can be run as a thread. The interface itself is very simple, describing only one method ( run ) that is called automatically by Java when the thread is started. The Runnable interface is usually used in conjunction with the Thread class. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q2215. What are scrollable ResultSet? Database
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   Q2216. What is EL in JSP? JSP
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   Q2217. What is difference between Executor.submit() and Executer.execute() method ? 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   Q2218. Can you write critical section code for singleton design pattern ? Design
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  singleton Q2219. What is difference between CyclicBarrier and CountDownLatch 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   Q2220. What do you mean by synchronized Non Access Modifier? 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   Q2221. Name few classes of java.util.regex package ? 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   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   Q2223. 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 Q2224. Explain toString method ? Which class contains this method ? Core Java
This question was recently asked at 'NEC Technologies'.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   Asked in 1 Companies 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   Q2226. What will the following code print and Why
class Class1 {
static{
System.out.println("Wow");
}
public static final int xyz=1;
}
class Class2{
public static void main(String[] args) {
System.out.println(String.valueOf(Class1.xyz));
}
} Core Java
Ans. 1
Reason being that Class1.xyz is replaced with 1 during pre compilation only and a reference to Class1 is never made. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  static final   pre compilation Q2227. Why java allows explicit import of class final static elements but not others ? Core Java
Ans. Because they can be replaced easily in pre compilation whereas others cannot. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q2228. Why do we have multiple core java jars in java 9 ? 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  java 9  java modules   java 9 modules Q2229. What is the concept of modules in Java 9 ? 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  java 9  java modules   java 9 modules Q2230. How modules are different than packages in Java 9 ? Core Java
Ans. Modules are independently build units and contains multiple packages. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  java modules   java 9 modules