It’s a great design question and asked a lot in java interviews. This post provides all the differences between abstract class and interface. When should we use interface over the abstract class and vice versa? The post also explains how to use abstract class and interface to create a flexi...
Another good Java interview question, I think answer is not sufficient but here it is “Substring creates new object out of source string by taking a portion of original string”. see my post How SubString works in Java for detailed answer of this Java question. 5. Which two method you ne...
That’s why this question is one of the java interview questions for experienced professionals.Java offers many primitives to help with this, but it takes experience to select the right one in each particular situation. Often, a tradeoff needs to be made between efficiency on the one hand, ...
Open to all. In my opinion throwing exception from constructor is an option.Answer:This is similar to previous interview question. Since constructor of Singleton class is supposed to beprivateit prevents creating instance of Singleton from outside butReflection can access private fields and methods, ...
[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...
In this case, the Java compiler will throw an error as “The method foo(String) is ambiguous for the type Test”. String and StringBuffer have no inheritance hierarchy. So none of them are more specific to others. A method is more specific than another if any invocation handled by the ...
Dear readers, the app for java developers! The app include bible of all java,best for java developers & interview. ---these Java Interview Questions have been…
Core Java - Interview Questions and Answers for 'Arraylist' - 27 question(s) found - Order By Newest Very frequently asked. Favorite question in Walk in Drive of many Indian service companies. Q1. What is the difference between ArrayList and LinkedList ? Core Java Ans. Underlying data...
Looking forward to appear in Java Interview, here are the key 100+ Java Interview Questions with Answers only for you including some of the tricky questions with answers.Table of ContentsSr.No.Question 1 What are new Java8 Features? 2 Difference between GET & POST METHODS? 3 Difference betwee...
For example, if I asked about this question on System design interview then I would approach it...