Learn Java and Programming through articles, code examples, and tutorials for developers of all levels.
Saturday, May 27, 2023
Aggregator Design Pattern In Java Microservices with Examples
What is Circuit Breaker Design Pattern in Microservices? How to implement it?
Friday, May 26, 2023
How to find Kth Smallest Element in a Binary Search Tree? [Solved]
How to find the maximum sum level in binary tree in Java? Example Tutorial
Thursday, May 25, 2023
Difference between application.properties vs Application.json vs Application.yml in Spring Boot
Difference between @RequestParam vs @RequestBody in Spring MVC? (with Example)
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.
Wednesday, May 24, 2023
10 Examples of RestTemplate in Spring Framework
How to Handle REST exception in Spring Boot Application? Example Tutorial
Hello everyone, in this article we are going to take a look at how to handle REST API exceptions in Spring Boot. It is crucial to handle errors correctly in APIs by displaying meaningful messages as it helps API clients to address problems easily. What happens if we don’t handle the errors manually? By default, the spring application throws a stack trace, which is difficult to understand. Stack traces are mainly for developers hence it is useless for API clients. That's why its very important to use proper HTTP code and error messages to convey errors and exception to client and also logging so that support team can better handle them. Ideally you should tell what went wrong and how to fix it? For example, if the error is due to duplicate data then clearly say, already existed, try with a new one. Similarly, if authentication fail then clearly say authentication failed instead of throwing some other exception.
Tuesday, May 23, 2023
Difference between VARCHAR and CHAR data type in SQL Server? [Explained]
What is window function in SQL with Examples? How and when to use them?
How Long It Take To Become a DBA (Database Administrator) in 2023? 7 days, 1 month or 1 year?
Hello guys, if you want to become a Database Administrator in 2023 and wondering how long does it take to learn SQL and Database and become a professional Database Administrator or Junior DBA then you are at right place. In the past, I have shared free SQL and Database courses as well roadmap to become a Web Developer and in this article, I am going to share how long it will take you to become a DBA in 2023. Along the way, I will share best way to learn SQL and Database and what is the best way to become a DBA quickly. So continue reading and find out what it takes to become a DBA and get a job in real world. I will also share all the skills you need to become a DBA in 2023.
Monday, May 22, 2023
How to set base URL for REST in Spring Boot? Example Tutorial
How to Enable Disable Spring Security in Spring Boot? Example Tutorial
Sunday, May 21, 2023
Top 5 Features Of Spring Boot 3 To Learn In 2023
How to do Integration Testing in Spring Framework? @SpringBootTest Example Java
Hello guys, if you are wondering how to test your Spring Boot application then you have come to the right place. Earlier, I have shared popular Spring Boot Testing Interview Questions and Spring Security Interview Questions and In this article, I will show you examples to test your Spring Boot application using @SpringBootTest annotation, which allows you to write Integration tests. When I talk about spring boot integration testing, I am talking about launching an application in ApplicationContext and performing tests. For integration testing, Spring Framework has a specific test module. It's referred to as a spring test. If we're going to utilize spring-boot, we'll need to use spring-boot-starter-test, which uses spring-test and other dependencies inside.
5 Essential Spring Boot Annotations with Examples in Java - Tutorial
Saturday, May 20, 2023
How to upload a file and JSON data in Postman? Example Tutorial
Spring Boot Backend + Vuejs Example [Java tutorial] - Part 1
In this tutorial, we will show you the Vue.js HTTP client and Spring Boot Server example that uses Spring JPA to do the CRUD with the H2 database and Vue.js as frontend technology to make requests and receive responses. But before moving to the Spring Boot and VueJs Example, Let's discuss what is Vuejs and its use cases.
Friday, May 19, 2023
Top 5 Spring 6 New Features Java Developer Should Learn In 2023
What is API Gateway Design Pattern in Microservices? With Examples
Thursday, May 18, 2023
Java + Spring Boot + Microservices Example - Step by Step Guide
Wednesday, May 17, 2023
Top 15 Microservices Interview Questions with Answers for Java Developers
Monday, May 15, 2023
Asynchronous Messaging In Java? JMS, Kafka, and RabbitMQ Examples Tutorials
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.
Sunday, May 14, 2023
How To Implement Security in Microservices Architecture
18 Spring Cloud Features for Microservices Architecture in Java?
Saturday, May 13, 2023
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.
Friday, May 12, 2023
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.
Wednesday, April 26, 2023
10 Reasons to learn Node.js for Web Developers in 2023
Angular vs React vs Vue.js ? Which is better to learn web development in 2023?
React Native vs Flutter? Which is better to learn for App Development in 2023?
How to Find Lowest Common Ancestor of a Binary Tree in Java? Example Tutorial
Hello guys, if you are wondering how to find the lowest common ancestor of a binary tree in Java then you are at the right place. Earlier, I have shared 40+ binary tree questions and today I am going to share solution of one of the popular binary tree question here. To find the lowest common ancestor of a binary tree in java requires that we run through a binary search tree and how it operates. What then is a binary search tree? A Binary tree is a data structure in which each node can have at most two children. That is, each node in the binary tree will have data, left child and right child. The first node of the tree is called the Root.
10 Git Commands Every Programmer Should Learn
Hello guys, Git is one of the most important skill for programmers, developers and data scientist and if you don't know git then you will struggle working in a team. If you want to learn Git in 2023 then you can start with these essential Git commands. I have explained the command and give you example. For examples, I have asked ChatGPT to see how it explains and I was amazed to see the response so I have included here for my own reference. I don't if ChatGPT will remain free forever but I am taking screenshot for the questions which I am asking so that I can keep a record for myself and you in future as ChatGPT is the best instructor I have got today and its helping me to learn and revise several key concepts.
26 Spring Framework Interview Questions Answers for 2 to 4 years experienced Java Developers
8 Examples of Primitive Data Types In Java (int, long, boolean, float, double, byte, char, and short)
Hello guys, Data types are first few things you should learn when you start learning a programming language and when it comes to learn Java, there are 8 primitive data types which you should know. These are divided into three categories, numeric, text, and boolean values. Numeric data types can be further divided into two like natural numbers and floating pointing numbers. But, Before we get to a list of the 10 examples of primitive data types in Java, let me tell you a little bit more about what the primitive data types are. There are essentially 8 primitive data types in Java. They are int, byte, short, long, float, double, boolean, and char. The primitive data types are not considered objects and represent raw values. These primitive data types are also stored directly on the stack.
10 points on TCP/IP Protocol, Java Programmers should Know
How to write to a File with try-with-resource in Java? Example Tutorial
Monday, April 24, 2023
What is try with resource in Java? Example tutorial
How to get the first and last item in an array in Java? Example Tutorial
How to use Deque Data Structure in Java? Example Tutorial
Difference between array and Hashtable or HashMap in Java
A couple of days back someone asked me about the difference between an array and a hashtable, though this is a generic data structure and programming question, I'll answer it from both a general programming perspective as well on Java perspective where Hashtable is not just a data structure but also a class from Java Collection API. Even though both array and hashtable data structure are intended for fast search i.e. constant time search operation also known as O(1) search, the fundamental difference between them is that array require an index while hash table requires a key which could be another object.
Anonymous Class to Lambda Expression in Java 8? Example Tutorial
Hello guys, you may be thinking why I am talking about Anonymous class now when many Java programmers have already switched to Java 8 and many have already moved on from Anonymous class to Lambda expression in? Well, I am doing it because I am seeing many Java programmers who find it difficult to write and read code using lambda expression in new Java 8 way. It's also my own experience that if you know the problem first, you can better understand the solution (lambda expression). Some of you might remember, the opening scene of MI 2 (Mission Impossible 2), when Nekhorovich says to Dimitri that "Every search for a hero must begin with something that every hero requires, a villain. Therefore, in our search for a hero, Belairiform, we created the monster, Chimera".
Top 20 YAML Interview Questions Answer for Developers and DevOps Engineers
Java FileReader + BufferedReader Example
10 Examples of print(), println() and prinf() methods In Java - PrintStream
Hello guys, if you are working in Java or just started with Java then you have must come across statements like System.out.println("Hello world") to print something on console or command prompt. This is actually the first statement I wrote in Java when I started programming and at that time I didn't realize how it work and what is System and PrintStream class and what is out here but now I know and I am going to explain all this to you in this article, along with PrintStream class and its various print methods like print(), println() and particularly printf() to print various objects in Java. But, Before we get to the 10 examples of Printstream printf() in Java, let me tell you a little bit more about what exactly Printstream is.
Top 20 Artificial Intelligence Interview Questions and Answers
Top 20 Bootstrap Interview Questions Answers for Web Designers and Developers
Hello guys, if you are preparing for web design and development interview and looking for Bootstrap interview questions then you have come to the right place. Bootstrap is one of the most popular CSS Framework and almost all websites uses Bootstrap for their classy look and feel and bigger buttons and form elements. Earlier, I have shared HTML 5 Interview Questions and best online courses to learn HTML, CSS and Bootstrap courses and today, I am going to share bootstrap interview questions with answers. Here is a chance for you to make sure that you go into that Bootstrap interview with your head up high. Being ready for that interview is the major step that you can make as you seek to impress the interview panel on the interview day.
Chain of Responsibility Pattern in Java? Example Tutorial
3 ways to convert String to JSON object in Java? Examples
Sunday, April 23, 2023
Top 10 Projects to Learn Front-End Web Development
How to use @JsonCreator and @JsonPropertOrder Jackson JN Annotation in Java? Examples
Top 5 Functional Interface Every Java Developer Should Learn
Hello guys, functional interface in Java are an important concept but not many developer pay enough attention to them. They learn lambda and method reference but the functional interface from java.util.function package. While its not really possible to learn all the functional interfaces on that package but you can learn a few more commonly used ones like Predicate, Supplier, Consumer etc and that's what you will learn in this article. But, before we get to the top 5 functional interfaces that every Java developer should learn, let me tell you a bit about what Java really is.
Difference between Class and Object in Java? Example
How to convert List Of of Object to Map of Object (key, value) In Java? Example Tutorial
What is WeakHashMap in Java? HashMap vs WeakHashMap Example Tutorial
Hello friends, we are here today again on our journey to Java. I hope everyone is fine and ready to board our train of knowledge. Today we are gonna learn something very interesting and very exciting. Today's topic will definitely be very useful in coding and programming. This topic would surely decrease your time complexity, and space requirements for any task very significantly :p So what's the wait? Let's start!
JDBC - Difference between PreparedStatement and Statement in Java? Answer
Can you make a class static in Java? Example
Difference between Fixed and Cached Thread pool in Java Executor Famework
Difference in Method Overloading, Overriding, Hiding, Shadowing and Obscuring in Java and Object-Oriented Programming?
Difference between HashMap vs TreeMap vs LinkedHashMap in Java
Difference Between Iterator and Enumeration In Java
Saturday, April 22, 2023
Top 5 Places to learn Cloud Computing Online for FREE in 2023 - Best of lot
Difference between Proxy and Decorator Pattern in Java
Top 20 Docker Interview Questions Answers Java Developers and DevOps
Top 30 Gradle Interview Questions Answers for Experienced Java Developers
Top 24 Node.js Interview Questions with Answers for 1 to 2 Years Experienced Web Developers
[Solved] How to find the Longest common prefix in Array of String in Java? Example Tutorial
How to check if a node exists in a binary tree or not in Java? Example Tutorial
10 Tools Every Software Engineer Should Learn In 2023
Hello guys, as a software engineer, staying up-to-date with the latest tools and technologies is essential to your success and one way to keep yourself up-to-date is to learn new framework, libraries and tools. Earlier, I have shared 5 Java Frameworks to learn in 2023 and in this article, we will introduce you to 10 tools that every software engineer should learn in 2023. The list includes, both essential and advanced tools from Git and Docker to TypeScript and GraphQL, which you will need in your day to day development, particularly on web development.
10 examples of crontab commands in Linux
Top 20 Ethical Hacking Interview Questions and Answers
Top 15 Machine Learning Interview Questions with Answers for 1 to 2 years Experienced
Hello guys, if you are preparing for Machine Learning interviews and looking for frequently asked Machine Learning interview questions then you have come to the right place. Earlier, I have shared the Data Science Interview Questions, best Machine learning courses, and essential ML algorithms and In this article, I am going to share common Machine Learning questions from interviews. To be honest, Machine Learning interview is not easy to crack, there can be different types of questions on Machine Learning interviews from key machine learning concepts like training the model to ask different types of machine learning algorithms.
Top 10 C++ Interview Questions with Answers for 1 to 2 years Experienced
Top 50 Microsoft Software Development Engineer Interview Questions
Hello guys, if you are preparing for Microsoft Software Development Engineer interview or in general preparing for FAANG coding interviews and looking for common interview questions for practice then you have come to the right place. Earlier, I have shared best Coding interview courses and books and in this article, I am going to share you some of the frequently asked questions from Microsoft. Most of the things depending upon for which position you are going like technical analyst, software engineer, Java developer, web developer or internship. If you have a computer science degree and if your job involves coding then you can expect following questions, which are mainly collected from engineers who has appeared on on and off campus interviews.
Friday, April 21, 2023
Difference between child and descendent selectors in jQuery in CSS?
Main difference between descendant and child selector in jQuery or CSS is that descendant selector selects all dom elements whether they are its direct children or not, on the other hand child selector only select direct childrens. Its very easy to understand if you know meaning of descendant and child. For example, my daughter is both my child and descendant but my granddaughter is not my child but descendant. Same definition work in both CSS and jQuery world Since jQUery got his selector from CSS itself, any difference between descendant and child selector which is valid for CSS is also valid for jQuery, unless otherwise stated. Now, lets understand this in terms of DOM elements
Top 12 Java NIO Interview Questions Answers for 5 to 10 Years Experienced Programmers
Top 20 Access Modifier Interview Questions Answers for 2 to 3 Years Experienced Java Developers
Access modifiers is one of the essential concept in Java and every programmer should be familiar with, and because of its importance, its also a popular topic in Java interviews. Access modifier can be applied to class, method, fields, and variables and as the name suggests they control the access. Like who can access that particular class, method or variable. For example, public modifier provides universal access which means any public class, method or variable is accessible by everyone and everywhere. In other words, you can access a public class both within the package and outside the package.
Top 30 Advanced Java Interview Questions for Experienced Developers
Hello guys, I have shared a lot of questions from Java Interviews in this article, so much so that many of my reader search Javarevisited for any Java interview question they come across. While In the past, I have shared Java concurrency questions, Java collections questions, Java questions on design patterns, and many tricky Java questions but a lot of people asked me to share more practical questions for experienced Java developers. Means, more advanced Java questions for 5 to 7 and even 10 years of experienced Java developers.
Top 20 Apache Spark Interview Questions and Answers
Top 20 Oracle Database Interview Questions with Answers for 3 to 5 Years Experienced
Top 21 Python Interview Questions Answers for 1 to 2 Years Experienced Programmers
Top 21 Groovy Interview Questions with Answers for Java developers in 2023
Top 20 PL/SQL Interview Questions with Answers in 2023
Top 20 DevOps Interview Questions with Answers for Experienced Developers in 2023
Top 18 CSS Interview Questions and Answers for 1 to 2 years experienced
Top 21 Git Interview Questions and Answers for Programmers and DevOps in 2023
Top 20 Golang Interview Questions with Answers
Thursday, April 20, 2023
Top 20 Hadoop Interview Questions and Answers for Java Developers
5 Difference between Iterator and ListIterator in Java?
HelloWorld Program in Java with Example
Difference between GenericServlet vs HttpServlet in Servlet JSP - J2EE question
How to iterate over HashSet in Java - loop or traverse Example
