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.
Ans. That depends if the interface for the resource in Project B gets changed. If only the internal implementation is changed, No change is required in Project A. Project A is not even required to be rebuilt.
Help us improve. Please let us know the company, where you were asked this question :
Ans. A dirty read occurs when a transaction is allowed to read data from a row that has been modified by another running transaction but not yet committed.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Yes, When either we don't want an object to be created ( class having all static elements and hence not required ) or object to be created using a static method or static block.
One such example could be a situation when we would like app to load objects at start up and we would like to restrict new object creation by any request.
Help us improve. Please let us know the company, where you were asked this question :
Ans. No, member variables of a interface are final by default.
The final ensures the value assigned to the interface variable is a true constant that cannot be re assigned by program code.
Help us improve. Please let us know the company, where you were asked this question :
Ans. This exception usually occur if we try to register the bean with name already present in the registry or repository. Usually this happens when multiple tests are executed at once in single container.
Help us improve. Please let us know the company, where you were asked this question :
Ans. NumberFormatException is the exception that Java throws when we try to convert one data type to the Number data type but the value is not parsable to be a Number.
For example , the following code will result in the NumberFormatException
String string = "Buggy";
int strtoInt = Integer.parseInt(string);
Help us improve. Please let us know the company, where you were asked this question :
Ans. Though there are many differences the way internally they both iterates the collections and streams respectively, but the main difference in performance that is achieved by spliterator as it can iterate Streams in Parallel whereas iterator only iterates collections sequentially.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Spliterator has better performance potential than iterators but only if the potential is used. Spliterator can iterate streams in parallel as well as in sequence whereas iterator can only iterate in sequence.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Such return is only expected in methods that returns void. the purpose of having return in such a method is to return the flow out of method and return to the place where it was called. Its actually used to prematurely return the control from the method.
Help us improve. Please let us know the company, where you were asked this question :
Ans. It make sense if its returning something. It doesnt make sense for void methods where return statement is not preceded by anything. In case of void methods , return as last statement has no impact and is actually a overhead.
Help us improve. Please let us know the company, where you were asked this question :