Preparing for Java and Spring Boot Interview?

Join my Newsletter, its FREE

Friday, May 31, 2024

Top 50 Free Spring Certification Practice Questions Answers for Java Developers

Hello guys, if you are preparing for Spring Professional certification in 2024 and looking for free Practice questions then you have come to the right place. I have an excellent update to share with you from 5th April 2024 onward, you don't need to complete any mandatory training or Spring Pro courses to become eligible for Spring certification, its free like it was before VMware acquired and now you just need to buy voucher to give this exam.  Earlier, I have shared best spring books and courses and today, I am going to share 50+ spring boot practice questions for this certification. To be honest, preparing for IT certification like Oracle's Java certification or VMware's Spring Certification required a lot of hard-work. I have seen many experienced Java developers failing these certifications and losing money and time due to overconfidence and lack of preparation. 

Difference between Setter vs Constructor Injection in Spring

Spring Setter vs. Constructor Injection
Spring supports two types of dependency Injection, using a setter method, e.g. setXXX(), where XXX is a dependency or via a constructor argument. The first way of dependency injection is known as setter injection while later is known as constructor injection. Both approaches of Injecting dependency on Spring bean has there pros and cons, which we will see in this Spring framework article. The difference between Setter Injection and Constructor Injection in Spring is also a popular Spring framework interview question

Thursday, May 30, 2024

How to sort a HashMap in Java 8 by keys and values using Stream and Lambda Expressions

Technically, you cannot sort a HashMap in Java because it doesn't guarantee any order. So, even if you add entries in sorted order they will be placed randomly and you won't be able to iterate over map in sorted order of keys or values. Though, if you want to process keys, values or entries of an HashMap in sorted order, you can get the data from the HashMap and then potentially use a TreeMap (when you want to sort a HashMap by key) or LinkedHashMap (when you want to sort a HashMap by value) to store entries in sorted order. This is also the way, we used to sort HashMap before Java 8. 

Wednesday, May 29, 2024

3 ways to Find First Non Repeated Character in a String - Java Programming Problem Example

Write a Java program to find the first non-repeated character in a String is a common question on coding tests. Since String is a popular topic in various programming interviews, It's better to prepare well with some well-known questions like reversing String using recursion, or checking if a String is a palindrome or not. This question is also in the same league. Before jumping into the solution, let's first understand this question. You need to write a function, which will accept a String and return first non-repeated character, for example in the world "hello", except 'l' all are non-repeated, but 'h' is the first non-repeated character.

Tuesday, May 28, 2024

Can you take Spring Professional Certification without Training Course? [Yes]

Hello guys, I have a big news to share with you now. Since 5th April 2024, you can take Spring certification without any mandatory training or Spring Pro content. So after a flip flop of making training mandatory, Spring certification is free again. Vmware, the company behind Spring, after acquiring Pivotal has reversed the earlier decision announced on 10th May 2017 by Pivotal, the previous owner of Spring Framework, that "Spring Certification Exams are now available for individual purchase, without enrolling in the course". This was one of the most discouraging changes in the Spring certification program since it's launched 10 years back. The cost of Spring certification was the single, biggest obstacle for many experienced Java and Spring developers to get certified for their Spring framework skills.

Top 25 Apache Kafka Interview Questions Answers for Java Developers

Hello, guys if you are preparing for the Java Developer or Apache Kafka interview and looking for frequently asked Apache Kafka interview questions and answers then you have come to the right place. Earlier, I have shared the best Kafka courses and popular interview questions on JavaJMSSpring Boot, and Hibernate and in this article, I Am going to share 20 frequently asked Apache Kafka interview questions with answers. Over the years, Kafka which is developed by Apache Software Foundation has gained popularity because of its immense capability of data processing and become a standard tool for high-speed and reliable messaging. 

Review - Is Grokking the System Design interview Course on DesignGuru Worth it?

Hello guys,  we are here again today for another exciting topic to discuss. But today, we will not discuss something related to Java or any other language or spring boot. Today, we will discuss something that is immensely practical and has the potential to land you very high-paying jobs. Today we are going to review a course that focuses on System Design! System Design is crucial for coding interviews! And it's also one of the most challenging topics to master. I have shared the best System design courses for coding interviews and books in the past. Today, I will review one of the top system design courses for technical discussions, Grokking the System Design Interview by Design Gurus.

Monday, May 27, 2024

Top 30 Programming questions asked in Interview - Java C C++ Answers

Programming questions are an integral part of any Java or C++ programmer or software analyst interview. No matter which language you have the expertise it’s expected that you are familiar with the fundamentals of programming and can solve problems without taking the help of API. Programming questions like reversing String using recursion or how to find if Array contains duplicates are some popular examples of programming question in Java. Programming questions present a lot of challenges Especially to Java developers as compared to C++ programmer and I think, One reason for this is powerful Java API; Which has a method for almost every need and you rarely need to write by your own or there are lots of third-party library from Apache, Spring, Google and other open sources.

Review - Is ByteByteGo System Design Interview Course by Alex Xu Really Worth it in 2024?

Hello guys, if you are preparing for System Design Interview in 2024 then you may have most likely come across names like ByteByteGo, Alex Xu or System Design Interview - An Insider Guide by Alex Xu, and if you are wondering what they are or you know about them but thinking whether ByteByteGo is worth it or not? then you have come to the right place. Yes, ByteByteGo is indeed worth considering for your System Design Interview preparation. because its created by Alex Xu, an expert with FAANG interview experience, the platform offers in-depth coverage of system design topics. The author's use of diagrams to explain concepts in detail enhances the learning experience. 

Saturday, May 25, 2024

12 Intermediate Database Administrator and Developer Interview Questions on Indexing

A good understanding of Index is very important for any programmer working with database and SQL. It doesn't matter whether you are working as DBA or Application developer, working in Oracle, MySQL, or Microsoft SQL Server or any other database, you must have good understanding of how index works in general. You should know different types of index and their pros and cons, how your database or Query engine chooses indexes and the impact of table scan, index scan, and index seek. You should also be able to build upon your knowledge to optimize your SQL queries as well as troubleshoot a production issue involving long running queries or poor performing queries. This is also a great skill for experience developers with 5 to 6 years of experience under his belt. 

How to Manage Distributed Transaction in Microservices? SAGA and 2 Phase Commit Example Tutorial

Hello guys, managing transaction in a distributed system like Microservices is very challenging and if you don't have a proper approach then you may face production issues and end of with data lose, data corruption and app failure. That's why managing distributed transaction is also an important topic on Microservice interviews. If you are working in Microservices architecture then you may have already heard about the SAGA and 2 Phase Commit etc. and there is also a chance that you may have been asked about those on Java developer interviews. If not, don't worry, in this article, I will tell you about those Microservices design patterns while showing how to manage distributed transactions in Microservices architectures in Java.  

Top 10 Websites to Learn System Design and Software Design in 2024 - Best of Lot

Hello guys, if you are preparing for System design Interview and looking for best resources to master Software design and System design then you have come to the right place. Earlier, I have shred best System Courses, Books, System Design Interview Guide, Cheat Sheets, and System Interview Questions and in this article, I am going to share best places to learn System design in 2024. Before we get to the best websites that will teach you everything you need to know about system design, let me tell you a little bit about what it really is. Systems design is basically the process of defining elements of a system including modules, architecture, components, interface, and data for a system based on a specific set of requirements. It can also refer to the process of defining, developing, and designing systems. These designs have to satisfy the specific needs of a company or an organization.

Friday, May 24, 2024

Top 10 Courses to Learn JavaScript in 2024 - Best of Lot

There is no doubt that JavaScript is the most popular programming language at this moment, and it's also confirmed by StackOverFlow's Survey. You can build static websites, web applications, native mobile applications (yes, you can do that too), desktop applications, and even server-side applications in JavaScript. It also makes you a hundred times more employer as there are tons of web development jobs out there. Because of that, more and more developers are learning JavaScript to become web developers.

Top 10 System Design and Software Analysis and Design Books in 2024 - Best of Lot

Hello guys, System design and Software design are two important topic for coding interviews and also two important skill for Software developers. Without knowing how to design System you cannot create new software and it will also be difficult to learn and understand existing software and system. That's why big technical companies like FAANG pays special attention to System design skill and test candidates thoroughly. If you want to learn System design and looking for best resources like best System design books and courses then you have come to the right place. Earlier, I have shared best System design online courses, as well as Software architecture courses,  and common System design questions and in this article, I am going to share with you best System design books to learn Software design. 

Top 10 Websites and Online Platforms to Learn Git for FREE in 2024 - Best of Lot

Hello guys, like many programmers, I have also worked with a lot of source control systems like SVN, CVS, TFS, VSS, Mercury, and I had always wondered why so many source control systems? Why not just one. It's one of the necessary software tools for development, and everyone needs a version control and code repository, there should be a standard solution. It seems Git and Github have solved that problem now. Now, Git is everywhere from open source to closed source, from small startups to big Investment banks, but there were still legacy projects which were lying on SVN and CVS, but they are now also started moving towards it.

Wednesday, May 22, 2024

Top 8 Online Courses to Learn Docker and Kubernetes in 2024 - Best of Lot [UPDATED]

Hello guys, how are you doing? Are you on track to accomplish your goals this year? I am sure you had made goals when this year was started, but if not, you can still check out 10 Things Java developers can learn in 2024. It's never too late. From my experience with interacting with many software developers, it seems DevOps, Docker, Kubernetes and Cloud Computing is the top priority for many programmers this year, especially senior Java developers. I have been receiving a lot of queries, emails, and chats about how to learn Docker and Kubernetes, two of the most popular DevOps tools. When it comes to learning, nothing beats personal training, but that's not always feasible; hence we need to rely on self-learning using books and online courses, and that's what I will suggest to you in this article.

How to Crack Java Programming Interviews in 2024? Topics, Courses, Books, and Questions

Java Interviews are a little bit different than traditional programming interviews on tech giants and product-based companies like Google, Amazon, Microsoft, or Facebook. First, even though it has questions from Data Structures and Algorithms like String or Array, you can still manage to clear Java interviews if you are not an expert on them. The questions are a little bit easier and more practical than those companies. Another essential thing about Java interviews are questions based upon Java programming language and JDK API. Since Java is also an Object-oriented programming language, you will find lots of OOP questions there.

Tuesday, May 21, 2024

Top 10 System Design Courses for Beginners and Experienced Developers in 2024 - Best of Lot

Hello guys, if you are preparing for System design interview and looking for best online courses to learn essential System design concepts like load balancing, API Gateway, scalability, Microservices architecture as well as learn how to solve popular System design questions like how to design YouTube, WhatsApp, Parking Lot, Library System as well when to use NoSQL and SQL then you have come to the right place.  In the past, I have shared best System Design Books, Free System design courses,  System design prep guide, and System Interview Questions and in this article, I am going to share best System Design Courses for beginners and experienced Software Engineer to level up their System Design skills in 2024. 

Monday, May 20, 2024

100+ System Design Interview Questions and Problems for Software Engineers

Hello guys, if you are preparing for System Design interviews then you may know that you have to prepare for theory questions as well as System design problems where you need to design a real world system like WhatsApp, YouTube or DropBox. Theory questions are mostly based upon System design basics and core concepts like Scalability, Caching, database sharding, load balancer, API gateway, security, proxies, messaging queues and software architecture, particularly Microservices. I have been sharing a lot of system design preparation material from last few years, in for example, in the past, I have shared System Design Interview Prep Guide as well as best System design interview books, courses, cheat sheets, and websites and in this article, I am target to share 100+ System Design Interview questions as well as System Design Problems.

Top 6 Free Data Structure and Algorithm Courses for Java and C Programmers

Data Structure and Algorithm is one of the essential topics for programmers, both to get a job and do well on Job. Good knowledge of data structure and algorithm is the foundation of writing good code. If you are familiar with essential data structures like an array, string, linked list, tree, map, and advanced data structure like Tries, AVL trees, etc and know when to use which data structure and compute the CPU and memory cost of your code in terms  Even though you don't need to write your own array, linked list or hash table, given every major programming SKD provides them like JDK or C++ STL library, you will need to understand them so that you can use them in right place. 

Using the right data structure can drastically improve the performance of an algorithm.

Sunday, May 19, 2024

Design a Vending Machine in Java - Interview Question

How do you design a Vending Machine in Java? is one of the popular Java interview questions mostly asked at Senior level Java developer Interviews. In a typical coding interview, you will be given a problem statement to develop a vending machine and within a limited time, usually, 2 to 3 hours you need to produce a design document, working code, and unit test in Java. One of the key advantages of such Java interviews is that you can test many essential skills or a candidate in one go. In order to complete the design, coding, and unit testing of a Vending machine, a candidate needs to be really good in all three departments. Recently, I have also seen this question on System Design Interviews, where interviewer want to check experienced developers knowledge on various Software architecture components and design decision. 

Saturday, May 18, 2024

Top 7 Spring Microservices Courses with Spring Boot and Spring Cloud in 2024 - Best of Lot

Microservices is the new buzzword in software development word and everybody is talking about it, but it's been in practice for quite some time especially in the form of RESTful web services. The idea of Microservices is simple, breaking a big monolithic application that contains everything from UI to service layer to database into small chunks of applications that are loosely coupled and can work on their own. For example, in a company like Uber, you could have several applications providing different services e.g. discovering when a driver is online or a passenger is searching for a cab, finding a route, traffic, and handling payments. These small applications are known as Microservices.

Friday, May 17, 2024

Top 10 Microservices Design Patterns and Principles - Examples

Hello guys, if you are using Microservice architecture and want to learn about different Microservice design patterns and principles to better architect your application then you have come to the right place. Earlier, I have shared the best Java Microservices courses and books for Java developers, and in this article, I am going to share the essential Microservice design principle and patterns. We will cover patterns like Event Sourcing, Circuit Breaker, SAGA, CQRS, Strangler, Database per Microservices, Backend for Frontend (BFF), Service Discovery,  and API Gateway and principles like Scalability, Flexibility, Resiliency, etc. When you developing an enterprise application, it is good to move with micro-services rather than move with a monolithic architecture. 

Top 5 Java Design Pattern Courses for Experienced Java Developers in 2024 - Best of Lot

Hello guys, today, we'll talk about design patterns and some of the best online courses to learn design patterns in Java from scratch. If you are wondering what is a design pattern and why Java developers should learn them? then let me give you a brief overview. Design patterns are nothing but a tried and tested solutions of common programming problems, for example, the creational design patterns deal with the problems of object creation. They exist from a long time but made popular by famous Gang of four of Erich Gamma, John Vlissides, Ralph Johnson and Richard Helm in their classic 1994 book Design Patterns: Elements of Reusable Object-Oriented Software, also known as GOF design patterns. This book documented 24 design patterns which are reusable to solve common programming problems. 

Top 10 Courses to Learn Spring Framework in Depth in 2024 - Best of Lot

Spring Framework is an essential skill for Java developers, not only to get a job as a Java developer but also for your career advancement. Since Spring is now used in almost every Java project, it becomes virtually mandatory to learn the Spring framework. Now, the question comes, what is the best way to learn the Spring framework? Are there any online courses out there that are focused on Spring? What are some good books and resources for learning Spring? These questions are widespread among Java developers, and I often see them on forums, online chat channels, and even many of my readers also ask this to me on Facebook chats and email. Well, the best way to learn any technology is by coaching, online courses, and books.

Wednesday, May 15, 2024

Difference between @Autowired and @Inject annotation in Spring?

What is the difference between @Autowired and @Inject annotation in Spring is one of the frequently asked Spring questions on Java interviews? Since everybody is now moved or moving to annotation-driven and Java configuration in Spring, this question has become even more important for prospective candidates looking for a Java web development job using the Spring framework. The @Autowired annotation is used for auto-wiring in the Spring framework. If you don't know, autowiring is a process on which the Spring framework figure out the dependencies of a Spring bean, instead of you, a developer, explicitly specifying them in the application context file. You can annotate fields and constructor using @Autowired to tell Spring framework to find dependencies for you.

Top 9 Courses to Learn SQL and Database in 2024 - Best of Lot

Hello guys, if you are a computer science graduate or new to the programming world, interested in learning SQL, and looking for some excellent resources, like books, courses, and tutorials to start with, then you have come to the right place. In the past, I have shared some of the best SQL books and tutorials, and today I am going to share some of the best SQL and database courses to learn and master this useful technology. If you don't know what SQL is and why you should learn it, let me give you a brief overview of SQL for everyone's benefit. SQL is a programming language to work with a database. You can use SQL to create database objects, like tables, stored procedures, etc., and also to store and retrieve data from the database.

Top 8 Udemy Courses to Learn System Design and Software Architecture in 2024 - Best of Lot

Hello guys, if you want to learn Software Architecture and System design in 2024 and looking for best resources then you will be happy to know that  I am going to share  8 best Udemy courses to learn Software architecture and System design for 2024. if you are preparing for technical interviews for Software Engineering job then you may be aware of  Software Design or System design. It is one of the most important but at the same time very tough topic to master and many programmers even experienced developer struggle to solve System design problems during interview, particularly while interviewing with top tech companies like Google, Meta, Amazon, Apple, Microsoft, Netflix etc, popularly known as FAANG (now MAANG) since Facebook is now Meta. 

Top 5 Courses to Learn Hibernate and JPA in 2024 - Best of Lot

Hibernate is one of the essential frameworks for Java and Java EE or JEE programmers, especially if you are working on the server-side of a Java Web development project. It's an ORM tool or a framework that allows you to deal with only objects while Hibernate takes care of your data on your behalf. For example, instead of writing classes with SQL to load, save, and update data using the DAO design pattern, you can simply use the Hibernate framework in your project. It will allow you to deal with just objects while it will load, save, and update data in the background. It's also one of the top Java frameworks in my list of top 10 Java frameworks Programmers can learn.

Tuesday, May 14, 2024

Top 20 Spring and REST Interview Questions Answers for Java/JEE Programmers

Hello guys, I have been sharing a lot of REST with Spring tutorials from last a couple of weeks and today, I am going to share some of the frequently asked Spring and REST interview questions to Java developers applying for Web developer roles. Since Spring Framework is the most popular and the standard framework for developing Java web application and RESTful Web Services, a solid knowledge of Spring core and Spring MVC is expected from any senior Java developer, but if the job description mention about REST and Web Services, you also need to be aware of how to develop RESTful Web Services using Spring Framework?.

Monday, May 13, 2024

Top 5 Books to Learn Spring framework and Spring MVC for Java Programmers

Spring and Spring MVC is one of the most popular Java frameworks, and most of the new Java projects use Spring these days. Java programmer often asks questions like which books are good to learn Spring MVC or the best book to learn Spring framework etc. If you are looking for the best Spring Framework books, then you have come to the right place. Earlier, I shared the best Spring Framework courses and best Spring Boot courses, and in this article, I will share the best books to learn Spring Framework for Java developers. There are many books to learn Spring and Spring MVC, but only certain books can be considered good because of their content, examples, or how they explained the concept involved in the Spring framework. 

Sunday, May 12, 2024

How to POST JSON request from Linux to test RESTful Web Services? Example

Even though, Postman is a great tool and chrome plugin to test RESTful Web services for Java developers, I often find myself using "curl" or "cURL" command in Linux for testing RESTful Web Services, particularly Java web services built using Spring or Spring Boot framework. The curl command is easily available on most of Linux hosts and you just need to type a command to sent various types of HTTP requests to your application from Linux command line, as shown here. Though, many RESTful web developer and tester knows this trick, they mainly use GET request to access data from web service and  many of them struggle to send HTTP POST request containing JSON data to create new resources. 

Saturday, May 11, 2024

Role based Access control using Spring Security and MVC, Mapping LDAP Groups to Authorities for Authorization

Authentication and Authorization is an integral part of any Java enterprise or web application. Since most of the company uses LDAP Active directory for authentication, authorization, and Role-based access control (RBAC), it's good to know How to implement Role-based access control using Spring MVC and Spring Security. This is the second part of my articles on using Spring Security for authentication and authorization in Spring MVC based Java application. In the last part, we have learned about doing LDAP authentication against Windows active directory, and in this Spring Security tutorial, we will learn How to map LDAP groups to authorities for implementing Role-based access control or authorization.

Friday, May 10, 2024

3 ways to solve java.lang.NoClassDefFoundError in Java J2EE

I know how frustrating is to see "Exception in thread "main" java.lang.NoClassDefFoundError" while running your Java application. This is one of the dreaded problem in Java  which is also a manifestation of NoClassDefFoundError in Java. I have seen it a couple of times and spent quite a lot of time initially to figure out what is wrong, which class is missing etc. The first mistake I did was mingling java.lang.ClassNotfoundException and NoClassDefFoundError, in reality, are totally different, and my second mistake was using the trial and error method to solve this java.lang.NoClassDefFoundError instead of understanding why NoClassDefFoundError is coming, what is the real reason behind NoClassDefFoundError and how to resolve this.

10 Examples of JdbcTemplate in Spring Framework

Hello Java programmers, If you have been using the Spring framework then you may know that the JdbcTempalte is one of the most useful classes of the Spring framework. The JdbcTempalte class provides lots of convenient methods for performing database-related tasks that take the pain away from using the JDBC API. If you have worked in any real-life Java project which connects to a Database using JDBC then you know that JDBC API is not very convenient to use as it requires a lot of boilerplate code. For example, to execute a simple SELECT query, you first need to create a Connection and Statement object to execute the query and iterate through a ResultSet Object to get the result of the query. Finally, you need to close all of these resources to prevent resource leaks in Java.

How to Solve java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener in Spring? [Example]

If you have worked in Spring MVC then you may be familiar with  
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
which is common problem during deployment. Spring MVC throws  java.lang.ClassNotFoundException:                           org.springframework.web.context.ContextLoaderListener ,
when its not able to find org.springframework.web.context.ContextLoaderListener class which is used to load spring MVC configuration files like application-context.xml and other Spring Framework configuration files defined in context-param element of web.xml in an Spring MVC web application as:

Thursday, May 9, 2024

How to Consume JSON from RESTful Web Service and Convert to Java Object - Spring RestTemplate Example

So far, I have not written much about REST and RESTful web service, barring some interview questions like REST vs. SOAP, which is thankfully very much appreciated by my readers, and some general suggestions about the best books to learn REST and best REST courses in the past. Today I am going to write something about how to consume JSON from a RESTful Web Service in Java using Spring Framework? I will also talk about how to convert the JSON to Java objects using Jackson. You will also learn about the RESTTemplate class from the Spring MVC framework, and how you can use it to create a REST client in Java in just a few lines of code.

Wednesday, May 8, 2024

Spring Boot + Kafka Example (Single and Multiple Consumer) in Java

Hello guys, if you want to use Apache Kafka with Spring Framework or Spring Boot and looking for an example then you have come to the right place. In the past, I have shared the best Spring Boot courses as well as best Apache Kafka courses for Java developers, and in this article, I am going to share how to use Apache Kafka with Spring Boot. You will learn both, to publish and consume messages from Apache Kafka topics in your Spring boot application. By the way, if you don't know, Apache Kafka is an open-source stream-processing software platform developed by LinkedIn and later they donated to Apache software foundation, king of open source development in Java world. 

Monday, May 6, 2024

How to set an "Accept:" header on Spring RestTemplate request? Example Tutorial

Hello Java programmers, if you have been using Spring for REST API development, both creation and consumption then you know that RestTemplate is one of the most commonly used tools for REST service invocations. So one of the major problems you might have in this RestTemplate is that how to set an "Accept" header on Spring RestTemplate request.  In the last article, I have shown you how to POST and Consume JSON using RestTemplate in a Spring Based Java application and In this tutorial, we will go through some important points on how to add headers to RestTemplate and fix the errors related to them. 

Saturday, May 4, 2024

Top 133 Java Interview Questions Answers for 2 to 5 Years Experienced Programmers

Time is changing and so is Java interviews. Gone are the days, when knowing the difference between String and StringBuffer can help you to go through the second round of interview, questions are becoming more advanced and interviewers are asking more deep questions. When I started my career, questions like Vector vs Array and HashMap vs Hashtable were the most popular ones and just memorizing them gives you a good chance to do well in interviews, but not anymore. Nowadays, you will get questions from the areas where not many Java programmer looks e.g. NIO, patterns, sophisticated unit testing or those which are hard to master e.g. concurrency, algorithms, data structures and coding.

Top 22 Spring Interview Questions Answers for Java Programmers [UPDATED]

Hey Java Programmers, if you are preparing for a Java developer interview then you should pay special attention to Spring framework-related questions. Spring framework interview questions are on the rise on Java web development and core Java interviews.  This is obvious given Spring Framework is the best most popular framework available for Java application development and now Spring IOC container and Spring MVC framework are used as a de-facto framework for all new Java development. Because of its popularity,  interview questions from the spring framework are top on any list of Java Interview questions and you should also prepare different Spring topics like Spring Boot, Spring Data JPA, Spring Security, Testing and Spring Cloud, etc to do well on Java developer interviews. 

How to fix @Autowired - No qualifying bean of type found for dependency in Spring Boot? [Solved]

Hello guys, if you are working in a Java and Spring Boot project and you are getting errors like "@Autowired - No qualifying bean of the type found for dependency " then you have come to the right place. Earlier, I have shared how to solve error creating bean with name in Spring framework and In this tutorial, we are going to discuss how to fix @Autowired - No qualifying bean of the type found for dependency. When we come across the org.springframework.beans.factory, we need to be careful. Whether there isn't a qualifying bean of type XXXX accessible, we should see if there is a spring bean called XXXX in the runtime. In most cases, we simply try to inject a bean that isn't defined.

Is "Java Concurrency in Practice" still Valid in the Era of Java 21?

Hello guys, one of my reader Shobhit asked this question on my blog post about 12 must-reads advanced Java books for intermediate programmers - part 1. I really like the question and thought that many Java programmers might have the same doubt whenever someone recommends them to read Java Concurrency in Practice. When this book came first in 2006, Java world was still not sure of about new concurrency changes made in Java 1.5, I think the first big attempt to improve Java's built-in support for multi-threading and concurrency. Many Java programmers were even not aware of new tools introduced in the API like CountDownLatch, CyclicBarrier, ConcurrentHashMap, and much more. The book offered them the seamless introduction of those tools and how they can use them to write high-performance concurrent Java applications.

Friday, May 3, 2024

Difference between @Component, @Service, @Controller, and @Repository in Spring

Before you learn the difference between @Component, @Service, @Controller, and @Repository annotations in the Spring framework, it's important to understand the role of @Component annotation in Spring. During the initial release of Spring, all beans are used to be declared in an XML file. For a large project, this quickly becomes a massive task, and Spring guys recognize the problem rather quickly. In later versions, they provide annotation-based dependency injection and Java-based configuration. From Spring 2.5 annotation-based dependency injection was introduced, which automatically scans and registers classes as Spring bean which is annotated using @Component annotation.

Wednesday, May 1, 2024

Top 20 Spring Framework Annotations Java Developers Should Know

Hello guys, annotations are quite important when working in modern Java application as almost all frameworks and libraries nowadays use annotations, including Spring Framework. There was time when we need to remember classes and methods to make effective use of JDK or any open source library but now we also need to remember annotations. For example, to use JUnit you must know about annotations like @Test, @BeforeEach, @AfterEach, @Disabled and so on. Similarly for Spring framework you need to know annotations like @Configuration, @Bean, @Component, @Service, @Value, @Autowired, @Repository, @Qualifier, @Required and more.