Monday, 26 June 2017

Top 25 Most Frequently Asked Interview Core Java Interview Questions ~ foundjava

We are sharing 25 java interview questions , these questions are frequently asked by the recruiters.Java questions can be asked from any core java topic . So we try our best to provide you the java interview questions and answers for experienced which should be in your to do list before facing java questions in  technical interview  .

Top 25  Java Interview Questions :

1. Which two method you need to implement for key Object in HashMap ?

2. What is immutable object? Can you write immutable object? 

3. What is the difference between creating String as new() and literal?


4. What is difference between StringBuffer and StringBuilder in Java ?

5.  Write code to find the First non repeated character in the String  ?

6. What is the difference between ArrayList and Vector ?

7. How do you handle error condition  while writing stored procedure or accessing stored procedure from java?

8. What is difference between Executor.submit() and Executer.execute() method ?

9. What is the difference between factory and abstract factory pattern?

10. What is Singleton? is it better to make whole method synchronized or only critical section synchronized ?

11. Can you write critical section code for singleton?

12. Can you write code for iterating over hashmap in Java 4 and Java 5 ?

13. When do you override hashcode and equals() ?

14. What will be the problem if you don't override hashcode() method ?

15. Is it better to synchronize critical section of getInstance() method or whole getInstance() method ?

16. What is the difference when String is gets created using literal or new() operator ?

17. Does not overriding hashcode() method has any performance implication ?

18. What’s wrong using HashMap in multithreaded environment? When get() method go to infinite loop ?

19. 
 What do you understand by thread-safety ? Why is it required ? And finally, how to achieve thread-safety in Java Applications ? 


20.  What will happen if you call return statement or System.exit on try or catch block ? will finally block execute?


19. Can you override private or static method in Java ?

20. What will happen if we put a key object in a HashMap which is already there ?

21. If a method throws NullPointerException in super class, can we override it with a method which throws RuntimeException?

22. What is the issue with following implementation of compareTo() method in Java


23. How do you ensure that N thread can access N resources without deadlock


24. What is difference between CyclicBarrier and CountDownLatch in Java ?

25. Can you access non static variable in static context?

1 comment:

  1. DATA STRUCTURE, CORE JAVA, JAVA TUTORIAL, JAVA STUDY, JAVA TECH, JAVA PROJECTS, JAVA ASSIGNMENTS, NIIT PROJECTS, NIIT ASSIGNMENMENTS, NIIT CYCLE TESTS, NIIT LAB@HOME, NIIT EXAMS MT, NIIT PMR, NIIT NOTES AND MUCH MORE GO TO https://solutionrk.blogspot.in/

    ReplyDelete