Skip to main content

Posts

Showing posts from 2021

Java Thread Interview Questions and answer

What is Thread in Java? Threads are basically the lightweight and smallest unit of processing that can be managed independently by a scheduler.  Threads are referred to as parts of a process that simply let a program execute efficiently with other parts or threads of the process at the same time.  Using threads, one can perform complicated tasks in the easiest way.  It is considered the simplest way to take advantage of multiple CPUs available in a machine. They share the common address space and are independent of each other. What are the benefits of using Multithreading? Allow the program to run continuously even if a part of it is blocked. Improve performance as compared to traditional parallel programs that use multiple processes.  Allows writing effective programs that utilize maximum CPU time Improves the responsiveness of complex applications or programs.  Increase use of CPU re...

Java interview questions and answers for experienced (Core Java, Spring Boot, Hibernate, JPA)

 Here is a list of interview questions for the experienced guy who had more than 5 years of experience in Java, Spring Boot, Spring MVC, Hibernate, JPA. Please follow the questions bank for it.   @component vs @service vs @repository @Component: It is to mark a bean as a Spring-managed component. It is a generic stereotype for any spring-managed component. Spring will only pick up and register beans with @component and doesn't look for @service and @Repository @service:  The @Service annotation represents that our bean holds some business logic. @Repository: @Repository is a stereotype for the persistence layer and it is also a type of component. Its job is to catch all persistence-related exceptions and rethrow them as Spring DataAccessExceptions. Explain spring Bean Lifecycle A Spring bean needs to be instantiated when the container starts, based on JAVA or XML bean definition. ...

Java Collections Interview Q&A List

 The collection framework is the most important concept in java programming. It is necessary that you should have strong knowledge of the Collection framework. Through this article, I will share the topmost interview question and answers that will definitely help you in clearing your interview with flying colors. 1). What is the collection in java? List down interfaces and classes. The Collection is a set framework of interfaces and classes that provides an architecture to store and manipulate the group of objects. Java Collections can achieve all the operations that you perform on data such as searching, sorting, insertion, manipulation, and deletion. 2).  What are the advantages of the Collection framework? Feature Description Performance The collection framework provides highly effective and efficient data structures that result in enhancing the speed and accuracy of a program. Maintainability The code developed ...