Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The code sleep(2000); puts thread aside for exactly two seconds. The code wait(2000), causes a wait of up to two second. A thread could stop waiting earlier if it receives the notify() or notifyAll() call. The method wait() is defined in the class Object and the method sleep() is defined in the class Thread.



More Java Questions - self test


4.1. Spring Core Interview Questions

I have tried to collect some top spring core interview questions which you face into your next technical interview e.g.

What is Inversion of Control (IoC) and Dependency Injection (DI)?
Difference between BeanFactory and ApplicationContext?
What is Spring Java-Based Configuration?
Explain Spring Bean lifecycle?
What are different Spring Bean Scopes?
Are Singleton beans thread safe in Spring Framework?
Explain different modes of bean autowiring?
Explain @Qualifier annotation with example?
Difference between constructor injection and setter injection?
Name some of the design patterns used in Spring Framework?

4.2. Spring AOP Interview Questions

Spring AOP (Aspect Oriented Programming) compliments OOPs in the sense that it also provides modularity. In OOPs, key unit is Objects, but in AOP key unit is aspects or cross-cutting concerns such as logging and security. AOP provides the way to dynamically add the cross-cutting concern before, after or around the actual logic using simple pluggable configurations

Go through these most asked AOP interview questions-

Difference between concern and cross-cutting concern?
What are the available AOP implementations?
What are the different advice types in spring AOP?
What is Spring AOP Proxy?
What is Joint point and Point cut?
What is aspect weaving?

4.3. Spring MVC Interview Questions

These Spring MVC interview questions and answers have been written to help you prepare for the interviews and quickly revise the concepts in general. I will strongly suggest you to go deeper into each concept if you have extra time. In general, you should be able to answer these questions-

What is MVC Architecture?
What is DispatcherServlet and ContextLoaderListener?
How to use Java based configuration?
How can we use Spring to create Restful Web Service returning JSON response?
Difference between <context:annotation-config> vs <context:component-scan>?
Difference between @Component, @Controller, @Repository & @Service annotations?
How does Spring MVC provide validation support?
What is Spring MVC Interceptor and how to use it?
How to handle exceptions in Spring MVC Framework?
How to achieve localization in Spring MVC applications?

5. Test Your Knowledge
5.1. Real Java interview questions asked for Oracle Enterprise Manager Project

So far you have been learning all different concepts in Java which can come in front of you in form of interview questions. It’s time to see whether you are prepared or not. Go through some real questions asked from Sreenath Ravva, in his interview with Oracle Corporation.

Can you just start telling about your self and your project?
What is abstraction and encapsulation in java ?
Method Overloading rules?
Widening and narrowing in java?
Can I have only try block in code?
Threads : producer and consumer problem?
Why wait(), notify() and notifyAll() are defined in Object class?
Can we override wait() or notify() methods?
Difference between wait(), sleep() and yield()?
Explain about join() method in thread class?
Have you faced out of memory error? If yes how you fixed ? Tell different scenarios why it comes?
Database connection leakage?
Write a program to swap two numbers with out using third variable?
Write a program to sort an array and remove duplicates?
Write a program on Singleton?
Write a program to merge two arrays?
What is the use of final and finally keywords?
Can I declare class as static or private?
Why you want to change the company?

Java Questions - softwaretestinghelp

...