Disclosure: This article may contain affiliate links. When you purchase, we may earn a small commission.

Spring Hello World Example in Java using Dependency Injection

Hello All, In this Spring framework tutorial, you will learn how to write the hello world example in the Spring framework. This should be your first tutorial to start learning the Spring framework, as it gets the ball rolling. While coding and running this example, you learn a lot about the Spring framework, Spring XSD files, necessary JAR files, and more importantly how the Spring framework works. This HelloWorld program in Spring framework is an extension of the classical Java hello world program, which you might have seen earlier. This program is written using the Dependency Injection design pattern by using the Spring Framework's IOC container.  Even though now you can configure Spring dependency using annotations and Java configuration, this example uses a traditional XML way to configure dependencies.

How Spring MVC Makes Easy to Create RESTful Web Services in Java

REST has now become a standard way to develop web services and when it comes to Java, there are many frameworks and libraries available like JAX-RS, Restlet, Jersey, RESTEasy, Apache CFX, etc, but I encourage Java developers to use Spring framework to develop RESTful web services. But, some of you might ask, why use Spring Framework to develop RESTful web services in Java? What is the advantage and why it's better than other frameworks and libraries available out there? Well, the most important reason I think to use Spring for developing RESTful web service is that you can use your Spring MVC experience to develop RESTful web services.

How to use @SpringBootApplication in Java and Spring Boot [Example]

Hello guys, today, we'll learn about the @SpringBootApplication annotation, one of the most important annotations from the popular Spring Boot framework, which has changed the way Java developers use the Spring framework for writing Java applications. In this article, I'll explain to you the meaning of @SpringBootApplication and its use in a simple Spring Boot application. We use @SpringBootApplication annotation on our Application or Main class to enable a host of features e.g. Java-based Spring configuration, component scanning, and in particular for enabling Spring Boot's auto-configuration feature.

Top 5 Books to Learn Spring Boot and Spring Cloud for Java Developers - Best of Lot

Hello guys, if you are a Java developer and want to learn Spring Boot and Spring Cloud frameworks and looking for some of the best books and courses, then you have come to the right place. In the past, I have shared some of the best Spring Boot courses and Spring Cloud courses, and today I am going to talk about some of the best books to learn Spring Boot and Spring Cloud, but before that let's try to understand what is Microservice and how Spring Boot and Spring Cloud helps with the development of microservices in Java. In simple words, Microservices is nothing but an extension of RESTful web services with the fundamental idea to break up your code into small, distributed, and independent services for better scalability and management, but it does require thoughtful design and think through ability.

How Spring MVC Framework works? How HTTP Request is processed?

One of the frequently asked Spring MVC Interview questions is about explaining the flow of web requests i.e. how an HTTP request is processed from start to end. In other words, explaining the flow of requests in Spring MVC. Since many of my readers ask this question time and again, I thought to summarize the flow of request processing in a short article. It all starts with the client, which sends a request to a specific URL. When that request hits the web container like Tomcat it looks into web.xml and finds the Servlet or Filter which is mapped to that particular URL. It the delegate that Servlet or Filter to process the request. Since Spring MVC is built on top of Servlet, this is also the initial flow of requests in any Spring MVC based Java web application.

Top 8 Python Libraries for Data Science and Machine Learning - Best of Lot

Hello guys, today I am going to talk about something which is not related to Java but a very interesting technology development that is happening around, and you simply can't afford to miss out on this opportunity. Yes, you guessed it right, I am talking about Machine learning, Artificial Intelligence, and Deep Learning. There is a good chance that you might have already heard about them and even started learning them. You may be either from Python camp or learning R programming for the sake of machine learning. When I started my journey of Machine learning and Data Science, I had to first make a choice about choosing the right programming language as both R and Python were doing great.

Java HashMap ContainsKey and ContainsValue Example

Hello guys, one of the common problems many Java developers working with HashMap face is how to check if the Map contains a particular key or value? You can use this to check duplicate keys or just to ensure that you are not overriding the current value because if you insert a key that already exists in the HashMap, then you end up overriding its value. Since HashMap also allows duplicate values, it's also possible that the same value may be paired against multiple keys, so just removing a mapping may not be enough to remove that particular value. Not paying attention to these details has actually caused issues in the Java applications.

Review of Udemy Best React Complete Guide Course by AcadMind and Maximillian Schwarzmuller

If you want to learn React.js and looking for the best online course to join or want to learn more about React - The Complete Guide Udemy course then you have come to the right place. Earlier, I have shared the best React and Redux courses and in this article, I am going to review, Udemy's best React course, React - The Complete Guide (incl Hooks, React Router, Redux) by Maximillian Schwarzmuller and AcadMind. This 72-hour long course is one of the best resources for people wanting to learn to React and Max has just re-recorded all lessons making it the most up-to-date course to learn to React.js library in 2021. 

Top 10 Java ConcurrentHashMap Interview Questions with Answers [UPDATED]

The ConcurrentHashMap class part of concurrent collections package added on JDK 1.5 which contains utility classes like BlockingQueue, CopyOnWriteArrayList, CopyOnWriteArraySet etc. It is a replacement of synchronized hash-based map implementations e.g. Hashtable and synchronized HashMap. It implements Map and ConcurrentMap (a sub-interface of Map) interface which allows you to store key-value pairs. The class is similar to HashMap or Hashtable but it's more scalable and the right fit for concurrent Java application. Unlike Hashtable which achieves its thread-safety by compromising the scalability, ConcurrentHashMap uses advanced techniques e.g. dividing the map into segments to remain thread-safe and scalable at the same time.

Java 9 Factory Methods for Collections Example - Creating Unmodifiable List, Set, and Map

Hello guys, this is my first article in Java 9 features on this blog, and today you'll learn about my favorite feature "factory methods for collection", which is introduced as part of JEP 269. The JEP stands for the JDK enhancement proposal. If you have worked in Groovy or Kotlin then you know that how easy is to create the list with elements using collection literals e.g. to create a list of 1, 2, 3 you can simply write val items = listOf(1, 2, 3). Unfortunately, Java doesn't support that yet but things have been improved with the factory methods for collection in JDK 9 and it's almost like that. JDK has added static factory methods like of() on to basic Collection interfaces which you can use to create a list of items.

Is The Complete Python Developer in 2022:Zero to Mastery by Andrei Neagoie worth it? [Udemy Course Review]

Hello guys, if you want to learn Python in 2022 and looking to join The Complete Python Developer in 2022:Zero to Mastery course by Andrei Neagoie on Udemy or ZTM Academy but are not sure then you have come to the right place. Earlier, we have shared the best Python 3 Courses to join in 2022 and today's article covers a review of one of the best online courses to learn the python programming language in 2022 for absolute beginners with no prior experience needed to start. This is a comprehensive course with almost 31 hours of content and also one of the most up-to-date courses to learn Python on Udemy. 

Review of Udemy's Machine Learning A-Z - Hands-On Python and R in Data Science - Is it worth it?

Hello there, If you want to learn Machine Learning and thinking whether Udemy's  Machine Learning A-Z - Hands-On Python and R in Data Science       an online course is worth it, nor then you have come to the right place. In this article, I have reviewed Udemy's Machine Learning A-Z - Hands-On Python and R in Data Science by Kirill Eremenko and Hadelin De Ponteves. Honestly, this is one of the best Machine Learning courses you can get at an affordable price and is suitable for both beginners and intermediate programmers and people who want to pursue Machine Learning. If you are in a hurry, I suggest you join the course, but if you have some time, then stay and read the full review to make an informed decision. 

For Gumroad Day, my Java and Spring Books are 'Pay What You Want', $1 minimum [TODAY ONLY]

Hello guys, just wanted to write a short post about the Gumroad sale and the once-in-a-lifetime opportunity to buy my books for just 1$ (minimum).  For #GumroadDay, both my books, Grokking the Java Interview and Grokking the Spring Boot Interview are 'Pay What You Want, $1 minimum. Today only.

- Grokking the Java Interview, $19.9 (normal price)
- Grokking the Spring Bot Interview, $19.9 (normal price)

More than 580+ Java developers have bought so far. Go see what they look like!

Top 5 Tools for Testing REST APIs and RESTful Web Services - Best of Lot

Hello guys, If you are a Java or web developer working on REST APIs and RESTful web services and looking for some tools to test your APIs and web services then you have come to the right place. Earlier, I have shared the best books and courses for RESTful web services and in this article, I am going to share five awesome but easily accessible and free tools to test your REST APIs. These REST API testing tools will help you to test your APIs as you build, starting from unit testing to integration testing and then fully automating your resting to create a regression pack. You can also use these tools to interact with your REST API during the development phase for quick tests. 

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. 

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.

Difference between BeanFactory and ApplicationContext in Spring framework

The difference between BeanFactory and ApplicationContext in Spring framework is another frequently asked Spring interview question mostly asked Java programmers with 2 to 4 years experience in Java and Spring. Both BeanFactory and ApplicationContext provide a way to get a bean from the Spring IOC container by calling getBean("bean name"), but there is some difference in their working and features provided by them. One difference between the bean factory and application context is that the former only instantiates bean when you call getBean() method while ApplicationContext instantiates Singleton bean when the container is started,  It doesn't wait for the getBean to be called.