Most of the time, we use finally block just to close the resources and sometimes we forget to close them and get runtime exceptions when the resources are exhausted. These exceptions are hard to debug and we might need to look into each place where we are using that type of resource to ...
Most Popular Java Interview Questions And Answers Given below is a comprehensive list of the most important and commonly asked basic and advanced Java programming interview questions with detailed answers. Q #1) What is JAVA? Answer: Java is a high-level programming language and is platform-indepen...
StringBufferandStringBuilderare mutable classes.StringBufferoperations are thread-safe and synchronized, whileStringBuilderoperations are not thread-safe. You should useStringBufferin a multi-threaded environment and useStringBuilderin a single-threaded environment.StringBuilderperformance is faster thanStringBuffer...
[Interview Question ][Data Structure] Two Sum Problem -Array Two sum problem is one of the most asked data structure questions for a java developer interview. There could be one or more ways to solve the problem but i am trying to give the optimized solution to this problem. Lets first ...
This is one of the tough Java interview question and its open for all, my friend didn't know the answer so he didn't mind telling me. my take is that stored procedure should return error code if some operation fails but if stored procedure itself fail than catching SQLException is only ...
Practical Java Interview Questions and Answer series (NEW Course Addition) Learn JAVA Step by Step (NEW Course Addition) Learn AngularJS 1.5 & 2.0 in 8 Hours jQuery, JSON & Javascript Frameworks Q/A series UML OOP's Q & A Video series Function Points Learn Design Pattern in 8 ...
There is really only one canonical answer, so the interesting thing is to see how the candidate approaches the problem.The fact that max() should run in O(1) time is a clear hint that the maximum needs to be stored. Upon realizing this, the interview candidate might think they have ...
java.lang.Exception: n and p should not be zero. java.lang.Exception: n or p should not be negative. java.lang.Exception: n or p should not be negative.Explanation 0In the first two cases, both n and p are positive. So, the power function returns the answer correctly. In the third...
Java intervieworJ2EE interviewat both beginners, experienced and intermediate level e.g. 2 to 4 years experienced Java programmer. In order to answer interview questions from Java collection framework, You need a good knowledge of various Collection interfaces e.g. Map, List and Set and familiar...
6What is similarities/difference between an Abstract class and Interface? 6.1Similarities 6.1.1They can be used to implement the polymorphism. 6.1.2Both of them can not be instantiated. 6.2Differences 6.2.1Interface can be used to implement the multiple inheritances while the abstract can not. ...