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

Top 5 Spring Cloud Annotations for Java Microservices

Hello guys, If you are developing a Java application for Cloud, then you should learn Spring Cloud, a great framework and extension of the popular Spring framework, which can help you to develop a cloud-native Java application. Spring Cloud provides several necessary services required for a cloud-based Java application and Microservices like configuration management, service discovery, circuit breakers, intelligent routing, micro-proxy, a control bus, one-time tokens, global locks, leadership election, distributed sessions, cluster state, etc.

Top 40 Java and Linux Interview Questions Answers for IT Support Engineers

Hello guys, if you are going for a Java support engineer interview and looking for some frequently asked questions then you have come to the right place. I have shared many posts about Java interview questions in the past but nothing, particularly from the support engineer perspective. Since there are a lot of L1 and L2 support job that exists in BFSI (Banking, Finance, and Insurance Industry) and they are also for the longer term, I decided to write this post. In this article, I will share questions to help with technical aspects like the essential skills you need to clear a support engineer interview.

How to Print SQL Statements in Spring Boot Application Log File? Example Tutorial

Hello guys if you are working on a Spring Boot application which loads and save data from database but you are not sure which queries are run on backend and you want to see them then you have come to the right place. Earlier, I have showed you how to set logging level in Spring Boot and In this article we are going to have a look at another very interesting topic from Spring Boot on how to log SQL statements in spring boot app. I know you might be wondering why I’m calling a very boring topic an interesting one? A proper logging is among one of the features that sets intermediate or experienced developers apart from beginners. 

Difference between Scala, Kotlin Java Programming

Hello guys, what is difference between Java, kotlin, and Scala is a common question from Java developers and new programmers who are learning these programming language for backend development. As a Java programmer and blogger, who has also worked extensively with Kotlin, I've often been asked about the differences between these two languages and how they compare to Java. While Java remains one of the most popular programming languages in use today, both Kotlin and Scala have gained significant traction in recent years, particularly in the realm of modern web development and microservices. 

Top 15 Spring Boot Interview Questions with Answers for Java/JEE Programmers

Hello guys, if you are preparing for your next Java interview and Job description mentioned about the Spring framework, then you should also prepare some Spring Boot interview questions to avoid disappointment. Spring Boot is now the standard way to use the Spring framework for Java development and almost all the companies are moving from the traditional way of using Spring Framework to a more modern Spring Boot way. Gone are the days, where questions like have you used Spring Boot " were asked to the developer. Nowadays interview expects more knowledge of Spring Boot from candidates and there are reasons for it, which we'll explore in this article.

10 Examples of New HttpClient + HttpRequest + HttpResponse In Java 11 (REST Client]

Hello guys, one of the notable addition in recent Java release is the full fledged HttpClient from Java. This is one of the class or utility which was much needed in Java. It was quite surprising that JDK doesn't have any fully functional HTTP client to connect to REST APIs in this world of API Integration. Until Java 11, Java developer rely on classes like RestTemplate and WebClient from Spring Framework to make HTTP class to REST APIs, but now you don't need to include Spring Framework in your project just for that. You can now use HttpClient class and its support classes like HttpRequest and HttpResponse to make both synchronous and asynchronous HTTP calls in Java. 

How to setup Request timeout in Spring Boot REST API? Example Tutorial

Hello guys, if you are wondering how to setup request timeout in your REST API using Spring boot then you have come to the right place. First thing first, when you make a request to another API in production, you must add timeout as there is no guarantee that you will receive response in time. Today we are going to take a look at setting up request timeout in Spring Boot Rest API. Before making it into the topic. Let’s first understand a few terms here. What is a Request timeout? A Request timeout is a deadline for services to respond to requests. It ended up returning an error with status 504 if the request fail to respond within the specified time. Request timeouts can help prevent a bad user experience, especially when a request is taking a long to respond to. There are various ways to set request timeout in Spring Boot

Top 40 Core Java Interview Questions Answers from Telephonic Round [UPDATED]

Hello guys, here is another post about preparing for Java Interviews, this time we will take a look at 40 core Java questions from the telephonic round of Java Programming interviews. Phone interviews are usually the first step to screen a candidate after selecting his resume. Since it's easy to call a candidate than to schedule a face-to-face interview, book rooms, and arrange for a meeting, a telephonic round of interviews is quite popular nowadays. There were days only one telephonic round of interviews was enough but nowadays, it's almost two and three rounds of phone interviews with different team members before you get a chance for face-to-face interviews. 

Difference between Abstraction and Encapsulation in Java and Object Oriented Programming? [Answer]

The difference between Abstraction and Encapsulation in Java is a common question in Java interviews for Beginners to check their understanding of Object-Oriented Programming and their ability to use them. Abstraction and Encapsulation in Java are two important Object-oriented programming concepts and they are completely different from each other. The only similarity between Abstraction and Encapsulation is that they are OOP concepts, other than that they mean two different things, but there is a confusing thing, both hide details to simplify things but for different reasons. 

Top 40 Binary Tree Coding Interview Questions for Programmers

Hello guys, if you are preparing for coding interviews and want to master tree-based questions then you have come to the right place. A tree is one of the most important data structures because it allows you to store hierarchical data as opposed to an array and linked list which allows storing linear data. That's why knowledge of tree data structure is very important from an interview point of view. A lot of programmers and my readers have been asking me to share some binary tree-based coding interview questions, just like I have done for the array, linked list, string, software design, patterns, hash table, and data structure in general. 

Top 30 OOP (Object Oriented Programming) Interview Questions Answers in Java

Java is an object-oriented programming language and you will see a lot of object-oriented programming concept questions in Java interviews. The classic questions like the difference between an interface and abstract class are always there but from the last couple of years more sophisticated questions based upon advanced design principles and patterns are also asked to check the OOP knowledge of the candidate. Though, Object-oriented programming questions are more popular on Java interviews for 1 to 3 years experienced programmers. 

Top 10 Object Oriented Programming Concepts Every Programmer Should Learn

Object-oriented programming (OOP) is a programming style that is used to solve the problem by thinking in terms of real-world objects like Car, Bag, Animal, etc. It also helps you to organize code, which makes it easier to understand and solve complex programs. Objects hold information about state and behavior. States are the characteristics of the object, or the words you would use to describe it, and usually, take the form of is or has descriptors. A computer is either on or off, a chair has four legs, and you have a name. Behaviors are the things the object can do, or the actions the purpose can perform and are usually verbs that end in ing like You are sitting, using a computer, and reading this article.

Can You Override Private Method in Java? Inner Class?

No, you cannot override private methods in Java, private methods are non-virtual in Java and access differently than non-private one. Since method overriding can only be done on derived class and private methods are not accessible in a subclass, you just can not override them. By the way, one more possibility of overriding private methods in an inner class, since private methods are accessible in an inner class, and that’s why it is one of the tricky java interview questions. Anyway, this will also not work because private methods are bonded during compile time and only Type (or Class) is used to locate a private method.

Top 10 Projects You Can Build to Learn Web Development in 2023

Hello guys, if you want to learn web development in 2023 then let me tell you that there is no better way to learn web development than building projects. Creating real world application give your experience which you can mention in your resume. They also expose you to challenges which real projects face like authentication, authorization, security, logging, performance etc. You also tend to remember things longer when you actually use it. So if you have learned API and methods by watching courses but haven't used them on any project then you will most likely forget them but if you use them in any project, you will retain knowledge for a long time. That's why I have been saying to may readers to build projects in 2023. 

Top 5 Projects You Can Build to learn Android App Development in 2023

Learning any programming language is not that easy as you need to practice a lot and write more and more code to gain experience. Reading books and articles does not make you a professional developer unless you test your skills by building real-world projects that showcase your knowledge and these concepts applied also on creating android apps. Watching YouTube tutorials or reading articles without trying yourself is not a good idea, many of you forget how to implement what he studied after some time because he never created projects and that’s not what you want so once you understand the basics you have to create at least a simple app.

Top 10 Projects You Can Build to Learn Java in 2023

Hello guys, from my 20 years of experience as a Java developer, from building games with J2ME to writing server side, multi-threading Java servers,  I can say that building project is the best way to learn Java but you also need to choose the right project because if you choose a trivial project you will not learn anything and at the same time, if you choose a hard project, you will frustrate and not complete it and not learn anything. That's why, its very important to choose the right kind of project when you learning Java. These project will not only complement your learning but also challenge you but not set an impossible task for you. Which means, you will learn and also have fund building them. If you are now looking for best Java Project ideas for beginners then you have come to the right place. 

How to Fix Consider defining a bean of type 'package' in your configuration [Solved]

Hello and welcome to another blog post. Today we are going to take a look at one of the most frequently appearing errors in the Spring Boot application. I’m sure most of us have faced a similar issue while working with the Spring Boot application, and the error is ‘consider defining a bean of type package in your configuration’. In general, The error "Consider defining a bean of type 'package' in your configuration" occurs when Spring Boot is unable to find a bean of a specific type that is required by your application. In this article, we will take an in-depth look at why this error appears in the first place. Moving ahead we will learn how to fix this issue. So without further ado let’s jump into it.

How to use Spring Boot and Thymyleaf in Java Web Application? Example Tutorial

Hello guys, if you are looking for a Spring Boot and Thymyleaf example, tutorial, or a project then you have come to the right place. Thymyleaf is one of the most popular, modern, server-side Java template engine to generate HTML and XHTML content. Earlier, I have shared Spring Boot + Reactjs project, as well a complete project to create Spring Boot + REST and Spring Boot + Microservices and in this tutorial, you will learn about how to create a spring boot and thyme leaf application using the h2 database.  So before moving to an example, let's discuss what is thymyleaf? Thymeleaf is a web application development library based on Java. It offers excellent support for providing XHTML/HTML5 in web applications.

Java + Spring Boot + Microservices Example - Step by Step Guide

Hello guys, if you are wondering how to create a Microservice in Java and Spring Boot then you are at the right place. In the past, I have shared best Spring Boot courses for Microservices, Interview Questions as well as essential Microservice design principles and patterns like API Gateway, Circuit breaker, CQRS, Event sourcing etc and In this article, we will cover the fundamentals of microservices with Spring Boot utilizing Spring cloud. We will cover a few fundamental ideas and then we will make a little microservices to give you an outline. I will also share step by step guide to make Microservices in Java and then deploy them using Docker and Kubernetes on Cloud. 

Asynchronous Messaging In Java? JMS, Kafka, and RabbitMQ Examples Tutorials

Hello fellow Java developers? Are you tired of those pesky synchronous messages clogging up your code like old grease in a drainpipe? Fear not, because today we're talking about asynchronous messaging in Java – the ultimate solution for decoupling your processes and improving the performance of your applications.  But before we dive into the juicy details, let's start with the basics. What is Asynchronous Messaging? Asynchronous messaging is a method of communication between two or more processes like Microservices, where the sender sends a message and doesn't wait for a response before continuing with its own tasks. This is in contrast to synchronous messaging, where the sender must wait for a response before continuing.

Top 5 Object Oriented Analysis and Design Interview Questions for Programmers, Software Engineers

Testing the design skill of a candidate is quite common in programming job interviews. Questions like, how do you design a vending machine or a traffic control system are very popular in object-oriented programming language interviews, like Java and C++. Designing a software System requires good experience and knowledge of tools of object-oriented design and analysis. You should not only be good at OOP fundamentals like Abstraction, Inheritance, Polymorphism, Encapsulation, Coupling, Cohesion, Association, Aggregation, or Composition but also on several crucial object-oriented design principles like SOLID Principles of Object-Oriented Design, which is the building block for writing flexible and maintainable code.

Aggregator Design Pattern In Java Microservices with Examples

The Aggregator design pattern in Microservice architecture is a design pattern used to compose a complex service by aggregating the responses of multiple independent microservices. It's also one of the essential Microservices Design patterns along with SAGA, CQRS, and Event Sourcing. This pattern is proper when a client request requires data or functionality distributed across multiple microservices. It can improve the performance and scalability of the system by allowing each microservice to focus on a specific task and reducing the workload of a single microservice. In this article, we will discuss how the Aggregator Microservice Pattern can be implemented in Java using various approaches, such as asynchronous communication, synchronous communication, or a combination of both. We will also provide examples of code to illustrate each approach.

What is Event Sourcing Design Pattern in Java Microservices? Example

Hello Java programmers, if you are tired of constantly trying to keep track of your application's current state using a traditional relational database then the Event Sourcing pattern might be just what you need. Event Sourcing is a popular pattern in Microservice architecture that allows services to persist and query the state of an application using a sequence of events instead of storing the current state. This pattern has gained popularity because it helps to build complex systems with a clear audit trail and support for long-term scalability. By storing a sequence of events, rather than just the latest state, developers can reconstruct the application state at any point in time, even after failures or bugs. It's also one of the 10 essential Microservice patterns I have shared earlier and it's one of the top 3 along with Saga and CQRS patterns which we have seen in my earlier articles.  

What is CQRS Pattern in Java Microservices? Command Query Responsibility Segregation Example Tutorial

Hello guys, if you are wondering what is CQRS pattern and when and how to use it in your Microservices then you have come to the right place. CQRS is one of the 10 essential Microservice pattern and can be used when your application is either read heavy or write heavy and reading and writing requirement are very different. It aims to separate your app into two parts, command part which writes data and query part which read data and that's how it allows you to develop, scale and optimize them separately. It's also one of the popular Microservices Questions and if you are preparing for interviews, you should prepare this pattern as well. Earlier, I have explained SAGA Pattern and Database Per Microservice pattern and in this article I will explain CQRS pattern, when to use it and what problem does it solve. 

SAGA Design Pattern In Java Microservices with Example

Hello guys, if you want to learn about SAGA Microservice design pattern then you have come to the right place. SAGA is one of the 10 essential Microservice Design Patterns I have shared earlier and it solve a critical problem related to distributed transaction. But, before we get to the different examples that will teach you all about SAGA microservice design patterns in Java, let me tell you a bit more about what it really is. A microservice-based application is basically a distributed system. The overall system consists of multiple minor services, which provide the overall application functionality. This architectural style offers numerous benefits as well as several limitations. SAGA Pattern is also one of the popular Microservice interview question and if you are going for interview, it make sense to learn and understand this design pattern in depth. 

Top 15 Microservices Interview Questions with Answers for Java Developers

Hello guys,  if you are preparing for Java interviews then preparing for Microservice architecture is a good decision but there are not many places where you can find Microservice interview questions, so I thought to share some common Microservices questions from Java interviews. If you are a regular reader then you may know that I have been sharing spring interview questions regularly like I shared spring boot questions last year and this year, I have shared spring cloud questions and spring data jpa questions so far. You can use those articles to prepare well for any Java and Spring boot interviews, but I also suggest spending some time learning core spring concepts as those are very important.

Top 5 Free Courses to Learn Microservices for Java Developers in 2023 - Best of Lot

Hello Java programmers, if you want to learn Microservice architecture and look for free Microservice resources like free online courses, you have come to the right place. Earlier, I have shared the best Microservice courses for Java programmers to build Microservice using Java and the Spring framework, and today, I will share some free courses to learn Microservice in Java using Spring Boot and the Spring Cloud framework. If you don't know, Microservices is a modern architecture that goes along nicely with cloud computing and makes deployment, scaling, and even development easier. 

Top 6 Online Courses to Learn Microservices with Java and Spring Boot in 2023 - Best of Lot

Hello guys, if you want to learn about Microservices architecture and how to create Microservices with Java using Spring Boot and Spring cloud framework and looking for the best online courses then you have come to the right place. Earlier, I have shared the best free Microservices courses for Java programmers and in this article, I am going to share the best online courses to learn Microservices with Java in 2023. Popularity of Cloud Computing has given an exponential rise to Microservices architecture because they go hand in hand. It's easy to scale Microservices which is the biggest advanced of Cloud Computing. If you don't know what is Microservices then don'
t worry, I will give you a brief overview. 

10 Examples of RestTemplate class in Spring Framework

Hello guys, if you are wondering how to send GET and POST request to your API or Web Service from a Java based Spring Framework then you would be glad to know that You can use use RestTemplate class from Spring Framework. It's a fully functional HTTP client which is really really useful in this age of API. I have used RestTemplate to consume JSON from API before as well as sending different kind of request like POST, PUT, DELETE and PATCH to any REST API. For example, in this article, I shared how to send POST request using RestTemplate and how to set header on HTTP request using RestTemplate. Yes, RestTemplate also allow you to send headers like Authorization on Http Request. 

What is ContextLoaderListener in Spring MVC? Example Tutorial

The ContextLoaderListner is one of the essential components of the Spring MVC framework, probably the most important after the DispatcherServlet itself. It is used to create the root context and responsible for loading beans, which are shared by multiple DispatcherServlet like beans related to the service layer and data access layer. In general, When you develop Spring MVC based web applications and also using Spring in the services layer, you need to provide two application-contexts. The first one is configured using ContextLoaderListener, and the other is set using DispatcherServlet. The DispatcherServlet is responsible for loading web component-specific beans like controllers, view resolvers, and handler mappings while, as I said before, ContextLoaderListener is accountable for loading middle-tier and data-tier beans which forms the back end of Spring applications.

How to access configuration values from file in Spring Boot? Example Tutorial

Hello guys, if you are wondering how to access a value defined in your spring application configuration file then you are not alone, many Java developer face the same challenge. How to access a value defined in the file in Spring Boot is a common question that arises when you dealing with large software applications. In software applications, you need to have different environments for the QA, production, and local. So as a solution for this, you can use different configurations and update the files separately without affecting other environments by using property files.

How to enable HTTP Caching in Java Web application with Spring MVC? Cache-Control Header Example

One of the standard requirement in a secure Java web application is to disallow the back button of the browser or invalid the session if the user hit the back button of the browser. You might have seen this behavior while doing online banking or net banking, almost all the banks don't allow you to use the browser's back button. Your session gets terminated as soon as you hit the back button, and you have to log in again to do any transaction. Btw, have you ever checked some situations on your Servlet and JSP-based Java web application, like, if you pressed the back button of your browser after logging in, what happened? You will find that the browser takes you to the previous page.

What is @Conditional annotation in Spring Framework? Example Tutorial

Hello guys, if you want to know what is @Conditional annotation in Spring Framework and Spring Boot, and how to use it then you have come to the right place. Earlier, I have shared best free courses to learn Spring Framework and Spring Boot, and in this article, you'll learn what they are, how to use them with practical examples. Spring 4.0 introduced the @Conditional annotation that is used for conditional checking for bean registration. This annotation offers more support than the @Profile annotation provided by the spring framework and most of the Spring Boot matching is attributed to this annotation. It allows you to setup features based upon certain conditions like presence of a class in classparth or a JAR File which is how Spring Boot Auto-configuration works.

What is @PropertySource Annotation in Java and Spring? PropertySource Example Spring Boot

Hello Java developers, if you are using Spring Framework or Spring Boot in your new project and wondering what is property source in Spring Framework and how to use @PropertySource annotation then you have come to the right place. Earlier, I have shared the best books and online courses to learn Spring Framework and in this article, I will teach you how to use @PropertySource annotation in Spring to read Environment variables and inject properties using @Value annotation. In the Spring application, one of the files that are needed to provide properties to the Spring environment is the @Configuration classes. 

How to call REST API an send HTTP GET and POST Request using cURL command in Linux? Example Tutorial

The curl or cURL command of Linux is a compelling and versatile command which allows you to send sophisticated HTTP requests right from your Linux command line window. You can use the cURL command to test your RESTful Web Services by sending GET and POST requests, doing authentication, saving a cookie in the file, etc. The curl command is, in fact, the go-to tool for many Java and Spring developers working in web applications and consuming data from the secured RESTful Web Services. Still, you can also use it to test your simple REST Web APIs without security. I have used it many times to check if our Web service is up or not, or is there any error while accessing those services.

How @Configuration, @Component, and @ComponentScan annotations works in Spring Framework? Component Scanning Example

Hello guys, if you are wondering how to does autowiring work in Spring Framework and how does Spring Framework find dependency in runtime then you have come to the right place. Earlier, I have explained How Spring MVC works and how Spring Security works, and In this tutorial, I will tell you how component scanning and auto-wiring works in Spring. You will also learn how to enable component scanning in a Spring application. When you develop a software application using spring, you need to tell the Spring framework where to look for Spring components. Using component scanning it is very much easier as this enables auto-detection of beans by spring container and smoothly.

Top 6 DevOps Online Courses for Experienced Developers in 2023 - Best of Lot

Hello guys, you may know that DevOps is one of the most in-demand skills for both big and small organizations. Consequently, DevOps Engineer is also one of the highest-paid technical jobs for people who don't want to do general jobs like people management or project management. If you are a senior developer, tech lead, or scrum master looking for a raise or taking your career to the next level, learn DevOps and tools like Docker, Kubernetes, Jenkins, etc. Maven can be a good option. These tools improve the software development and deployment process in your team and boost your profile and career.

Top 6 Online Courses to Learn Design Pattern in Java for Experienced Programmers in 2023 - Best of Lot

Hello Java programmers, if you want to learn Design patterns in 2023 and looking for the best resources like books, tutorials, and online courses then you have come to the right place. Earlier, I have shared the best design pattern books, interview questions, and design pattern tutorials and in this article, I am going to share the best design pattern courses for Java developers. A design pattern is the tried and tested solution of classical software problems which is common during software development. Knowing design pattern not only help you to solve those problems quickly but also encouraged you to use tried and tested solution, thus overall improving the quality of the software application you are building. 

Top 5 Courses to Learn Quarkus for Java Microservices online in 2023 - Best of Lot

Hello guys, If you are looking for a Spring Boot alternative for Microservice development in 2023 and if you're interested in learning more about frameworks like DropWizard, MicroNaut, and Quarkus for creating Microservices in Java, then you've come to the correct spot. In the past, I have shared the best free Microservice courses using Spring Boot, and RxJava, and talked about essential Microservice principles and patterns in this article, I am going to share the best online courses to learn the Quarkus framework in 2023. 

What is YAML? How to define List and Map in YAML? Example Tutorial

Hello everyone, in this article we are going to take a look at how to use List and Map in YAML file. But before we jump into the topic. We start by defining the YAML document and why it is used. What advantages does it offer compared to the properties file?  But before that let's learn what is YAML? and how different it is from JSON and XML, two popular technology for configuration declaration. YAML stands for yet another markup language. YAML is a well-known programming language because it is simple to grasp and human-readable. Additionally, it can be combined with other programming languages. YAML is most extensively used in Ansible for declaring and defining playbooks.

Top 20 Python Interview Questions and Answers for 1 to 2 Years Experienced

Hello guys, if you are preparing for Python developer interview and looking for common and frequently asked Python Interview Question then you have come to the right place. Earlier, I have shared best Python courses, books, and projects and today, I am going to share best Python Interview questions with answer to get you the Python developer job you always wanted. Understanding python is easy if you choose to. What is needed is more and more practice. In this article you will find the questions that are frequently asked during python interviews. You have to take your time and go through the questions with answers and you will be more than prepared as far as python interview is concerned. 

Top 20 Kubernetes Interview Questions Answers for 1 to 3 Years Experienced

Hello guys, if you are preparing for Software developer or DevOps engineer Interview where Cloud Computing and Kubernetes skill are needed or mentioned in Job description then you should prepare for Kubernetes questions on Interviews. Kubernetes has quickly become an essential tool to deploy your application on Cloud and that's true not just for Java developers but also for Python, JavaScript, and Golang developers. If you already know the importance of Kubernetes and looking for common Kubernetes questions from interviews then you have come to the right place. Earlier, I have shared both Docker Interview questions and DevOps Interview Questions and in this article, I am going to share 20 common Kubernetes questions with answers.

Top 15 HTML5 Interview Questions with Answers for 1 to 2 years Experienced

Hello guys, if you are preparing for web design or web development interview and looking for HTML 5 interview questions to revise key HTML 5 topics and concepts before interview then you have come to the right place. In the past, I have shared best HTML and CSS courses and in this article, I will share 15 common HTML 5 interview questions with answers for web design and web development interviews. You can use this list to quickly prepare for HTML 5 interviews. HTML is one of the three core technologies of the World Wide Web(WWW). It is the most essential part of a web application. Along with CSS and JavaScript, HTML is necessary to learn for web development. HTML is the easiest to learn and understand. 

Top 27 Dynamic Programming Interview Questions for Interviews

Hello guys, if you are preparing for tech interview or any Java developer interview then apart from preparing for Data Structure and Algorithms, and System Design, you should also prepare for Dynamic Programming questions. Dynamic programming or DP is a technique to solve a problem by breaking a big program into small sub-problem and then combining the result. It's very similar to Recursion and that's why Recursion also plays an important role in solving Dynamic programming questions.  When it comes to Interview, DP is one of the toughest topic to master.

Top 25 Linked List Coding Interview Questions for Java Programmers

Hello guys, if you are preparing for Software Development interview or want to become a Software Engineer then you must pay full attention to two important topics: first is Data Structure and Algorithms, and second is System Design. These two topics are very essential and you will always find questions from these in any coding interview. They are also the most difficult to crack as they are very vast, no matter how much you will prepare there will be certain questions which you don't know but if you have solid knowledge of fundamental data structure like array, linked list, binary tree, hash table, heap, and graphs as well sorting and searching algorithms like quicksort, merge sort, selection sort, insertion sort, binary tree as well advanced String and graph algorithms then you can still do well.

Top 5 Free Coursera Courses for SQL and Database in 2023 - Best of Lot [UPDATED]

Hello guys, if you want to learn SQL and Database and looking for best free resources like books, online courses and websites then you have come tot he right place. Earlier, I have shared best SQL courses, SQL books, and best websites to learn SQL and in this article, I am going to share best free SQL courses from Coursera, one of the best place to learn technical skill from world's top university and companies online. While many people are familiar with Coursera courses and certifications then don't know that most of the Coursera courses can be taken for free-to-audit where you can watch them for free without enrolling on specialization or professional certification. Only thing is you don't have access to quizzes and exercise sand you don't get certificate but you can still learn from worlds' top trainers and instructors. 

Top 5 Free Big Data Courses to Learn Hadoop, Spark, and Kafka in 2023 - Best of Lot

Hello Java Programmers, If you want to learn Big Data technologies in 2023 like Hadoop, Apache Spark, and Apache Kafka and you are looking for some free resources like books, courses, and tutorials, then you have come to the right place. This article will share some of the best free online practices to learn Hadoop and Spark from Udemy and Pluralsight at your own pace. I like to start with FREE resources before I have enough knowledge to choose the right book or enroll in a little expensive course. It's also my passion to surf the web to find great free resources and share them with you guys.

5 Best Free Flutter Courses Online for Beginners in 2023 - Best of Lot

Hello guys, if you want to learn Flutter for App development in 2023 and looking for free Flutter online courses and tutorials then you have come to the right place.  In the past, I have shared the best Flutter Courses but many of my readers asked for free online Flutter courses to start with and that's how this article is born. In this article,  you will find a list of free online courses to learn Flutter from the best instructor on the internet. These courses cover Flutter as well as Dart, in case you don't know, Dart is a programming language and Flutter is the framework for creating mobile and web apps using Dart.

Top 10 Free Git Courses for Programmers and DevOps in 2023 - Best of Lot

Hello guys, there is no doubt that Git is one of the most essential tool and skill for every programmer and Software developer. Gone are the days where different companies uses difference version control like SVN, CVS, or TFS, now almost every company uses Git which has become the standard source repository and version control tool. That's why its important for every programmer to learn Git and its not that easy. Git is a distributed version control system and there are things like remote repository, local repository, commit, pull, push, fetch, rebase, merge etc which can be confusing to many programmers and that's why I am going to share best free Git courses you can join to learn Git in 2023.

Top 5 Hibernate and Spring Data JPA Online Courses in 2023 - Best of Lot

Hello Java programmers, if you want to learn Hibernate and Spring Data JPA, two of the leading persistence framework for enterprise Java development, and need the best resources like books, tutorials, and online courses then you have come to the right place. In the last article, I have shared the best Spring framework courses, and best Hibernate booksand today, I am going to share the best online courses to learn both Hibernate and Spring Data JPA in 2023. These are the top-quality courses from popular online learning platforms and sites like Udemy, Pluralsight, and Baeldung and are trusted by thousands of Java developers around the world to learn these essential frameworks for Java developers. 

Top 5 Java Performance Courses for Experienced Developers to Learn in 2023 - Best of Lot

Hello guys, if you have been doing Java development for few years, then you know that Performance is the key for any Java application. As a senior Java developer, one should know how to improve the performance of Java applications and understand memory management and garbage collection, which often causes Performance in Java applications. These are some advanced skills that take some effort to develop. It doesn't come by default even if you have been programming in Java for years, as most people don't touch these topics. Many of them are afraid or take the performance tuning work and always look up to the most senior or brilliant developers in their team.

Top 20 Selenium Interview Questions Answers for Programmers and Automation Test Engineers

Hello guys, if you are preparing for Selenium Developer or Automation Testing Engineer interview and looking for frequently asked Selenium Interview Questions then you have come to the right place. Earlier, I have shared 130+ Core Java Interview Questions and 20 JUnit Interview Questions and in this article, I am going to share 20 common Selenium questions from interviews with answers. If you have worked with Selenium or used Selenium in your project then most likely you can answer all of these questions but if you struggle to answer any of these Selenium interview questions then you have always go back and check one of these best Selenium online course to learn and revise key Selenium concepts. 

How to read files from the resources folder in Spring Boot? Example Tutorial

Hello everyone, welcome to the blog post. In this article, we are going to take a look at a frequently asked question in spring boot on how to read files from the resources folder. A resource is any file that contains information relevant to your project, including configuration files, picture files, data files, or other types of files. In this article, we will look at various methods and techniques that both spring boot and ordinary Java code allow us to read a file from the resources directory. Our goal is not simply to list these approaches; rather, we will describe each strategy with the help of an example so that, everyone can easily grasp the topic. Without further ado, let's get started. 

Top 20 Advanced Java Questions on Anonymous Class, Nested Static and Inner Class for Interviews

Hello guys, static class and nested classes are one of the tricky topic to master in Java and that's why they are quite popular on Java Interviews. Not many Java developer knows about Anonymous class or how Lambda is compiled into Anonymous class by JVM etc. If you are going for Java Interview, I highly recommend you to prepare nested class topic well in Java. Just like in the past, I have shared many Java in-depth questions on different topics like Lambda Expression, Stream API, Generics, Collections, Multithreading, String, array, Design Patterns, OOP, Spring Framework, Hibernate etc,

Top 5 Free Courses to Learn Jenkins, Docker, DevOps, Maven, and Kubernetes in 2023 - Best of Lot

Hello guys, you might have heard about DevOps and all the attention it is getting now. DevOps is a new phenomenon, and there is a mad race among senior developers to become a DevOps engineer. Well, I am not one of them as my passion is for becoming a software architect, but I have indeed spent some time learning DevOps just to increase my knowledge of the field as I strongly believe in the phrase, jack of all and master of one :-). In the DevOps world, tools matter a lot, and the whole of the DevOps phenomenon to create an automated pipeline for delivering quality software heavily relies on clever uses of tools like Maven, Jenkins, Docker, Kubernetes, and others.

My Favorite Courses to learn React.js in Depth in 2023 - Best of Lot

Hello guys, if you want to learn React.js in 2023 and looking for the best resources like books, online courses, tutorials, and guides, then you have come to the right place. In the past, I have shared the best free React.js courses, best React books, websites, projects, and even a complete React.js Developer RoadMap and in this article, I am going to share the best online courses to learn React.js in 2023.  You've come to the correct spot if you're a web developer or someone who is passionate about web development and want to learn React or React JS, a popular JavaScript framework for developing a component-based user interface.

Top 20 Data Analyst Interview Questions Answers for 1 to 3 Years Experienced

Hello guys, if you are preparing for Data Analyst interview and looking for frequently asked Data Analysis questions then you have come to the right place. Earlier, I have shared common Data Science questions, Machine Learning Questions, and AI questions from interviews and in this article, I am going to share common Data Analyst Interview Questions with answers for 1 to 3 years experienced people. If you have worked in the field of Data Analysis then most likely you will know the answers of all of them but if you cannot answer then I suggest you to join a good Data Analysis course like Google's Data Analyst Professional certificate on Coursera to learn and revise essential Data Analysis concepts.

Top 5 Courses to learn Docker in Depth - Best of Lot

Hello Java programmer, if you want to learn Docker and looking for the best Docker Courses from Java and Spring Boot developer point of view, then you have come to the right place. Earlier, I shared free Spring Boot courses and Docker courses, and in this article, I will share the best Docker courses for Java and Spring developers. Java is one of the most popular and widely used programming languages. It is an evergreen programming language. For Java developers, Docker is a game-changer. Docker is emerging rapidly, and it's now one of the most essential tools for all kinds of programmers, and there are reasons for it like Docker makes both development and deployment easier. 

Top 7 Online Courses to Learn Go or Golang in 2023 - Best of Lot

Hello guys, if you want to learn the Go programming language in 2023 and look for the best Golang online courses, you have come to the right place. Earlier, I shared the best JavaScript Courses, and today, I will share the best online lessons to learn one of the modern programming languages called Go or Golang. This popular, next-generation, highly efficient programming language is created by none other than Google, creator of Angular, Android, Flutter, and Dart, to make their software development process smoother and better. 

Top 20 Azure Interview Questions and Answers for IT Professionals

Hello guys, if you are preparing for Azure Cloud Engineer interviews and looking for common Azure Interview Questions and Answers then you have come to the right place. Earlier, I have shared 20 Cloud Computing Interview Questions and 20 AWS Questions for interviews and today, I will share frequently asked Azure Cloud interview questions with answers. If you have worked as Azure Engineer then you can easily answer all of these questions but if you cannot then you can always go back and join one of these best Azure online courses to learn and revise key Azure concepts, services, and platform details. The list contains best online courses to learn Azure from popular websites like Udemy, Coursera, and Pluralsight. 

Top 20 Tailwind CSS Interview Questions and Answers

Hello guys, if you are preparing for web designer or web developer interview where Tailwind CSS skills are needed and you are looking for common Tailwind questions to prepare for interview then you have come to the right place. Earlier, I have shared common CSS interview questions and Bootstrap questions, another important CSS framework and in this article, I am going to share 20 frequently asked Tailwind CSS interview questions with answers. These questions covers essential Tailwind concepts and if you have worked with Tailwind or used Tailwind in past then you can easily answer these questions but if you forgot and struggle to answer them then you can also checkout one of these best Tailwind CSS books and courses to learn and revise Tailwind concepts quickly. 

8 Difference between TCP and UDP Protocol in Java? Networking Question

What is the difference between TCP and UDP is a popular networking question from Java interviews? Though TCP or UDP is Java independent concept and very likely to be asked in other programming language interviews as well, many programmers do not really understand them clearly. They sure have heard them because TCP and UDP are two of the most important transport protocol of the internet, but when it comes to listing down the difference between them, they fail to mention key differences in terms of ordering, guaranteed delivery, speed, and usage. 

Top 25 React Native interview Questions Answers

Hello guys, if you are preparing for React Native Developer interview and looking for common React Native Interview questions and answers then you have come to the right place. Earlier, I have shared best free online courses to learn React Native and in this article, I am going to share 25 React Native Questions you can prepare for any Job interview. Mobile application development has advanced at a rapid pace in the last decade. As the usage of mobiles has increased immensely, more and more companies have figured that mobile applications are the future. So because of this increasing demand for mobile applications, the technology has advanced to keep up with the expectations.  

Top 43 Java IO and File System Interview Questions with Answers for 1 to 3 Years Experienced

Good knowledge of Java IO API is important for any Java developer but many of them barely pay attention to Java IO and NIO API, and that's why they often struggle during Java interviews when a question related to Input-Output operation is asked. In the past, I have shared many Java interview questions on topics like Collections, Concurrency, JVM internals, Garbage Collection, OOP, Design Patterns, and Data structure based coding problems, which received good feedback and helped many Java developer on their Java Interview preparation. Consequently, many of my readers were also asking about Java IO and File-based interview questions and this was one of the pending items on my TODO list for quite some time.

Top 24 Java Date, Time, and Calendar Interview Questions Answers

The Date and Time API is a significant one for day-to-day Java development work, but many interviewers don't ask enough questions on this topic. Most of the questions are based on either Java Collection framework like  HashMap, ConcurrentHashMap, or ArrayList or multi-threading concepts like volatile, synchronized, and atomic variables. This is not good, and many interviewers have realized that a good understanding of date and time API is also important for a good Java developer. That's the main reason for increasing date, time, and calendar-based Java interview questions in recent times, particularly in the last couple of years.

Top 10 Online Courses to Learn Data Structure and Algorithms in 2023 - Best of Lot

Hello guys, In the past, I have shared a lot of useful resources like books and tutorials to learn Data Structure and Algorithms for both beginners and experienced programmers. I have also shared a lot of Data Structure and Algorithmic interview questions like this and their solutions in Java. Still, I have got continuously queries about excellent online courses to learn Data Structure and Algorithms in Java. Even though the topics are completely independent with the programming language, Java developer definitely likes the online courses which teach Data Structure and Algorithms in Java, and that's why my recent post about best algorithms courses, which includes algorithms courses from JavaScript and Python didn't impress my readers.

Top 10 Udemy Courses for Java Developers - Best of Lot

Hello guys, if you are looking for best Udemy courses to learn Java and Spring Framework then you have come to the right place. Earlier, I have shred best Pluralsight courses for Java developers and best LinkedIn Courses for Java developers and today, I will share best Udemy courses for Java developers in 2023. Before we get to the important part and give you a list of the best courses that you can use to become expert Java programmers, let us start with the basics first. What is Java? In the most basic of terms, Java is a general-purpose, object-oriented, and class-based programming language that is known for having lesser implementation dependencies.

Difference between Chef and Ansible in DevOps

Hello guys, Ansible and Chef are two popular configuration management tool which are very important in this world of DevOps. What is difference between Ansible, Chef, and Puppet is also a common questions for DevOps and senior Java developer who are also responsible for setting their server and installing application. Earlier, I have shared best DevOps Courses and best online courses to learn Ansible and Chef and in this article, we will go through the difference between two widely recognized configurations management tools used by DevOps engineers i.e. Chef and Ansible.

Top 10 Courses to Learn System Design and Software Architecture in 2023 - Best of Lot

Software design or System design is one of the tricky concepts to master. You can quickly learn a programming language like Java or Python, but creating software using that programming language is a totally different thing. That's where software design and coding skills come to the rescue. It's actually an art to structure your program, design your modules, specify boundaries and interactions with other parts of the system so that they are easier to read, maintain, and flexible to change. It's one of the most essential skills for a software developer but often gets ignored. If you look for an online course to learn Software design and architecture, you won't find many, forget about good ones.

CodeCademy vs Datacamp vs Udemy? Which one to Join in 2023?

Hello guys, if you are looking to upskill yourself this year, want to learn new tech and programming skill, and want to join an online learning platform or are confused between Udemy, Codecademy, and Datacamp then you have come to the right place. In the past, I have reviewed Udemy, Pluralsight, and Educative and in this article, I am going to review Udemy, DataCamp, and Codecademy learning platforms based upon their strength and weaknesses, and learning styles. For most people, online education is one of the best approaches to achieving your goals, whether starting a new business or learning new programming skills and even negotiation in general. 

Top 10 Tools for REST API Development and Testing to Learn in 2023

Hello guys, it's been a long time since I have shared useful tools. Last, I have shared the best tools for Java developers to learn and then the best data visualization tools for Data Scientists to learn. So, today, I am going to write about 10 essential tools for REST API development and Testing. These are the tools that will help you in every stage of your REST-based project like design, development, testing, and documentation. If you are creating REST APIs in Java or any other programming language, most of the tools like Postman which are HTTP based are equally useful but a couple of tools are most suitable for Java developers.Without wasting any more of your time, here is my list of 10 useful tools every REST developer should learn

10 Examples of WebClient In Spring Framework and Java

Hello guys, if you are wondering how to use WebClient on Spring Framework and looking for simple how to examples of WebClient then you have come to the right place. Earlier, I have shared 10 example of RestTemplate in Spring Framework and in this article, I Am going to share 10 example of WebClient in Spring. These examples covers everything from sending GET request to REST API and consuming response, and also sending POST, PUT, and PATCH request to RESTful Web Services. You will also learn how to set header like Basic Authentication and Authorization header, cookies and much more.  

Top 20 Firebase Interview Questions and Answers for Developers

Hello guys, if you are preparing for Firebase Developer Job interview or interviewing for a Job where Firebase skills are needed and you need Firebase interview questions to prepare quickly and better then you have come to the right place. Earlier, I have shared HTML Questions, CSS Questions, and JavaScript Questions and tutorials and today I am going to share best Firebase Questions with answers. If you have used Firebase for few months or worked as Firebase developer then most likely you know the answers of these questions but if you struggle then you can always join any of these best Firebase courses to further learn  and revise essential Firebase concepts. 

Difference between wait() and join() methods in Java Multithreading? [Answered]

Hello guys, if you are wondering what is difference between wait() and join method in Java multithreading and when to use each of them then you have come to the right place. Earlier, I have shared best Java multithreading courses and books and today I will answer this common Java threading question for you. Even though both wait() and join() methods are used to pause the current thread and have a lot of similarities they have different purposes. One of the most obvious differences between the wait() and join() methods is that the former is declared in java.lang.Object class while join() is declared in java.lang.Thread class. This means that wait() is related to the monitor lock which is held by each instance of an object and the join method is related to the thread itself. The wait() method is used in conjunction with notify() and notifyAll() method for inter-thread communication, but join() is used in Java multi-threading to wait until one thread finishes its execution.

Difference between vs Application.json vs Application.yml in Spring Boot

Hello guys, if you have worked in any Spring Boot application then you may have noticed that there are multiple ways to declare configuration for Spring Boot application. I am sure you must have noticed application.propties, application.json, and application.yml while working in proprietary or open source Spring Boot application. When I first started, it was application.propties and it was quite familiar because I have used properties file in past for specify configuration of Java application but when I first see applcation.json and application.yml I was bit confused like what they are and does they really work? In the end I found out that they are just different ways to specify configuration for any Spring Boot application. 

Difference between Callable and Runnable in Java? call() vs run() method

Hello guys, the difference between the Callable and Runnable interface in Java is one of the interesting questions from my list of Top 15 Java multi-threading questions, and it’s also very popular in various Java Interviews. The Callable interface is newer than the Runnable interface and was added on Java 5 release along with other major changes e.g. Generics, Enum, Static imports, and variable argument method. Though both Callable and Runnable interfaces are designed to represent a task, which can be executed by any thread, there is some significant difference between them. 

What is Volatile Variable in Java? When to Use it? Example

What is a Volatile variable in Java?
The volatile variable in Java is a special variable that is used to signal threads and compilers and runtime optimizers like JIT that the value of this particular variable is going to be updated by multiple threads inside the Java application. By making a variable volatile using the volatile keyword in Java, the application programmer ensures that its value should always be read from the main memory and the thread should not use the cached value of that variable from their own stack. With the introduction of the Java memory model from Java 5 onwards along with the introduction of CountDownLatch, CyclicBarrier, Semaphore, and ConcurrentHashMap.

Difference between Docker Kubernetes for Programmers and DevOps

Hello guys, If you're a Java developer or doing Software Development in any programing language and interested in cloud-based technologies like containers, you've probably heard of Docker and Kubernetes and may be wondering what they are and how they connect. Should I use Kubernetes or Docker? is a common way to start the debate between the two. Earlier, I have explained you why Every programmer should learn Docker and Kubernetes and In this article, we are going to discuss these two technologies again and see the difference between Docker and Kubernetes and find out how they differ from each other, when to use Docker and Kubernetes, and what value they provide.

Difference between synchronized block and method in Java? Thread Example

Synchronized block and synchronized methods are two ways to use synchronized keywords in Java and implement mutual exclusion on critical sections of code. Since Java is mainly used to write multi-threading programs,  which present various kinds of thread-related issues like thread-safety, deadlock, and race conditions, which plagues into code mainly because of poor understanding of the synchronization mechanism provided by the Java programming language. Java provides inbuilt synchronized and volatile keywords to achieve synchronization in Java. The main difference between the synchronized method and the synchronized block is a selection of locks on which critical section is locked.

Top 12 Java Thread, Concurrency, and Multithreading Interview Questions and Answers

Java concurrency and thread interview questions answers
Multithreading is an important feature of the Java programming language, which means threads are also an important part of any Java interview. It's true and in fact, at beginners and freshers, level Thread interview questions in Java are one of the most difficult to answer. One reason for interview questions related to multithreading and concurrency being difficult is confusion around how multiple threads work together and the second is threads are genuinely a complicated topic to understand and use correctly.

Producer Consumer Problem with Wait and Notify - Thread Example Tutorial

The Producer-Consumer Problem is a classical concurrency problem and in fact, it is one of the most powerful concurrency design patterns which is used in most multithreaded Java applications. In the last article, I have shown you how to solve the Producer-Consumer problem in Java using blocking Queue but one of my readers emailed me and requested a code example and explanation of solving the Producer-Consumer problem in Java with the wait and notify method as well Since it's often asked as one of the top coding questions in Java. In this Java tutorial, I have put the code example of the wait notify version of the earlier producer-consumer concurrency design pattern. 

Java CountDownLatch Example for Beginners - [Multithreading Tutorial]

Hello Java programmers, the CountDownLatch is an important concurrency utility class that was added in JDK 1.5 to facilitate inter-thread communication without using wait and notify methods, but unfortunately, many Java developers still struggle to understand and use this powerful tool. In this article, you will learn what is CountDownLatch and how to use it to write better concurrent applications in Java. You can use the CountDownLatch if you are spawning multiple threads to do different jobs and want to know when exactly all tasks are finished so that you can move to the next stage. In other words, you can block a thread until other threads complete their task

Difference between @RequestParam vs @RequestBody in Spring MVC? (with Example)

Hello everyone, in this article, we are going to look at an interesting topic from the Java Spring framework and the topic is, to find the difference between @RequestBody and @RequestParam. If you don't know this is one of the frequently asked Spring MVC interview question and also two of the most used annotation when creating backend of a Java web application in Spring Framework. Earlier, I have explained difference between @RequestBody and @ResponseBody in Spring MVC and REST APIs, and in this article, I am going to tell you the difference between @RequestBody and @RequestParam annotation in Spring Framework. It is worth noting that these two annotations are frequently used in Spring Boot REST API.

2 Ways to Read a Text File in Java? BufferredReader and Scanner Examples

You can read a text file in Java by using either Files, BufferedReader or Scanner class. Both classes provide convenient methods to read a text file line by line e.g. Scanner provides nextLine() method and BufferedReader provides readLine() method. If you are reading a binary file, you can use FileInputStream. By the way, when you are reading text data, you also need to provide character encoding, if you don't then the platform's default character encoding is used. In Java IO, streams like InputStream are used to read bytes, and Readers like FileReader are used to read character data.

Difference between Spring Boot vs Spring Cloud in Java

Hello guys, if you are wondering, what is difference between Spring Boot and Spring Cloud then you re not alone. Many Java developer are not familiar with various spring boot projects like Spring Security, Spring Data JPA, Spring Batch, Spring Boot, Spring Cloud etc and this lack of knowledge prevent them from taking full advantage of Spring Framework.  In last article, I have explained difference between Spring framework and Spring Boot and in this article we are going to discuss the difference between Spring Boot and Spring Cloud. Before we dive into the difference between the two terms. Let us take a look at different terms like Spring, Spring Boot, and Spring Cloud.

How to do Inter process communication in Java? MemoryMapped File Example Tutorial

Hello guys, in the past, I have shown you how to do inter-thread communication in Java using wait-notify, and today, I will teach you how to do inter-process communication in Java. There are many ways to do inter-process communication in Java, you can use Sockets, both TCP and UDP, you can use RMI (Remote Method Invocation), you can use web services, or you can use memory-mapped file. The socket is the most common way of achieving inter-process communication if two processes are in two different hosts and connected via a network. RMI and WebService can also be used for similar purposes, but the last one, inter-process communication using memory-mapped files, is particularly useful if you are communicating with other processes in the same host, sharing the same memory and file system.

Why wait() and notify() method should be called inside a loop in Java? Example

Hello Java programmers, if you have used the wait() and notify() method in Java then you know that the standard idiom of calling the wait() method uses a loop, but have you ever thought why? This is even advised by none other than Joshua Bloch, a Java guru and author of the popular Effective Java book, a must-read for any Java programmer. When I first started using this method, I was puzzled why not just use the if block because ultimately we are testing for a condition and then either waiting or going for further processing. An if block is more readable for the testing condition than a while loop like for the classic producer-consumer problem, the waiting condition for producer thread could be written as :

Java CyclicBarrier Example for Beginners [Multithreading Tutorial]

This is the second part of my concurrency tutorial, in the first part, you have learned how to use CountDownLatch and in this part, you will learn how to use CyclicBarrier class in Java. CyclicBarrier is another concurrency utility introduced in Java 5 which is used when a number of threads (also known as parties) want to wait for each other at a common point, also known as the barrier before starting processing again. It's similar to the CountDownLatch but instead of calling countDown() each thread calls await() and when the last thread calls await() which signals that it has reached the barrier, all threads started processing again, also known as a barrier is broken. 

Difference between wait and sleep in Java Thread? Example

Wait vs sleep in Java
Differences between wait and sleep methods in Java multi-threading is one of the very old questions asked in Java interviews. Though both wait and sleep put the thread on waiting for state, they are completely different in terms of behavior and use cases. Thread.sleep(long millis) is meant for introducing pause, releasing CPU, and giving another thread an opportunity to execute while wait is used for inter-thread communication in Java. These methods are defined in java.lang.Object class and available to every object in Java. It is based upon object lock, if you remember every object in Java has an implicit lock, also known as a monitor.

How to Sort ArrayList of Objects by Fields in Java? Custom + Reversed Order Sorting Comparator Example

There are a lot of examples of Sorting ArrayList in Java on the internet, but most of them use either String or Integer objects to explain sorting, which is not enough, because in real-world you may have to sort a list of custom objects like your domain or business objects like Employee, Book, Order, Trade, etc. In order to sort an ArrayList of custom or user-defined objects, you need two things, first a class to provide ordering and a method to provide sorting. If you know about ordering and sorting in Java then you know that the Comparable and Comparator class is used to provide the ordering for objects.