Disclosure: This article may contain affiliate links. When you purchase, we may earn a small commission.
How to create RESTful Web Services in Java using Spring Boot? Example Tutorial
Hello guys, if you are looking for a complete tutorial to create REST API on
Spring Boot then you have come to the right place. In the past, I have shared
the best RESTful Web Services courses and
best Spring Boot courses
and in this article, I am going to show you how to create RESTful web services
using Spring Boot step by step. After going through this tutorial you will be
able to create your own REST endpoints and RESTful application using Spring Boot
and Spring Framework and Java programming language. How to make Spring boot REST
API? is a common question that everyone has who is new to Spring boot
application development.
Labels:
REST
,
spring
,
spring boot
How to use Lombok in Java? Lombok @Data and @NonNull Annotations Examples
Hello Java programmers, if you have been doing professional Java development, you may have heard about Lombok library, one of the most popular Java libraries among professional Java developers, making coding in Java much more fun and rewarding. Java has always been criticized for its verbosity, and many programming languages like Scala and Groovy are invented to solve that problem, but Lombok solves that problem in Java itself. This means you don't need to learn a new programming language, but you can use the Lombok library and its annotations to write clear and concise code in Java.
Labels:
core java
,
Lombok
,
programming
How to upload/download file in Spring MVC and Spring Boot Java application? Example Tutorial
Hello guys, if you are wondering how to upload file and download files from a Spring MVC application then you have come to the right place. This is an important functionality for any real-world application and knowing how to upload a file in a Spring application is important for professional Java developers and that's what you will learn in this Spring MVC tutorial. Earlier, I have shared several Spring Boot tutorial like Spring Boot + Microservices, and Spring Boot + REST and even how to upload files using Servlet and JSP using Apache Commons FileUpload library and In this tutorial, we are going to discuss how to upload and download files using Spring MVC.
Labels:
spring
,
spring boot
,
spring mvc
How to use Mockito to Unit test Java Program with JUnit? Example Tutorial
Hello guys, if you are writing unit test your Java application then you would
have definitely come across JUnit and Mockito, two of the essential unit
testing framework for Java developers. While
JUnit
offers support to run your test, setup and teardown and also assertion to
check the expected and actual output.
Mockito
complements JUnit by offering you a mock based testing approach. Mock is
nothing but a test double which can return a configured value when a certain
method is called. It also provides ability to check if a particular method is
called or not. By using
Mock object
or test double you can check if your code is behaving properly or not in
different scenarios. This is also the key difference between JUnit and
Mockito, JUnit provides infrastructure to run your test while Mockito provide
infrastructure to created Mock objects.
Labels:
JUnit
,
JUnit testing
,
Mockito
How to Enable log SQL statements in Spring Boot? Example Tutorial
Hello guys, if you are a Java developer developing Spring Boot applications, you may need to have proper
knowledge of various kinds of errors and also how to overcome those. For example, most of Java developers use JPA in spring boot to make our work easy when managing databases. If you get an
error like an internal server error (504 error), you need to go through your
backend system and find the error. In many cases, these errors are caused by running invalid SQL or due to error on database. At that time, you often need to know which SQL statements are executed by Hibernate or JPA, or any other database library you are using.
Labels:
spring
,
spring boot
,
SQL
Top 10 Matrix Coding Exercises for Programming interviews and Homework
Hello guys, if you are preparing for Coding interviews and solved 100+ data structure problems then you may know that Matrix is one of the under-rated topic for coding interviews but Matrix
coding problems are not that easy to solve and In this article, we'll
see some of the popular Matrix coding problems for coding interviews. I
actually learned a lot by solving Matrix related problems. I still remember
the first Matrix based problem I solve was about
how to multiply two matrices in Java
and I learned a lot about multi-dimensional array and nested loop in Java by
solving that problem. The second problem I solved was about transposing Matrix
and that was also quite challenging for me at that time but helped me to
further solidify my knowledge about loops and array in Java.
Labels:
Coding problems
,
interview questions
,
Matrix
How to find first recurring or duplicate character in given String? [Solved]
Hello guys, while surfing the Internet for a couple of weeks back, I come to
know that this problem was asked on Google interviews,
find the first recurring character in a given String. I don't know if
that's true but this looks like a very simple coding problem from Google's
Interview standard. If it was indeed asked, then that guy must have been
very lucky. Anyway, I liked this coding problem and thought to write about
it, because it's a good coding problem to check candidates'
data structure and algorithms skills
because it's tricky. It's tricky because it's very easy to make a mistake
assuming just one recurring character in String, which you should
avoid. Even if it was not asked on Google, you will potentially find this problem
on various startups, and other IT companies like Infosys, TCS, Cognizant,
Microsoft, and maybe
Amazon.
Labels:
Coding problems
,
data structure and algorithm
,
String
Difference between CAST, CONVERT, and PARSE SQL Server? Example Tutorial
Though all three, CAST, CONVERT, and PARSE are used to convert one data type into another in SQL Server, there are some subtle differences between them. The CAST method accepts just two parameters, expression, and target type, but CONVERT() also takes a third parameter representing the format of conversion, which is supported for some conversions, like between character strings and date-time values. For example, CONVERT(DATE, '2/7/2015', 101) converts the character string '2/7/2015' to DATE using DATE format 101, representing United States standard.
Labels:
Microsoft SQL Server
,
SQL
,
SQL Interview Questions
Difference between SQL, T-SQL and PL/SQL?
Hello guys, if you are preparing for SQL and Database Interviews or any Software engineering interview and looking for difference between T-SQL, SQL, and PL/SQL then you have come to the right place. Earlier, I have shared 50 SQL Interview questions and 12 SQL query Examples from interviews and today, we are going to see another common and interesting SQL interview question, what is the difference between SQL, T-SQL, and PL/SQL? It is also one of the most common doubts among SQL beginners. It's common for programmers to think that why there are many types of SQL languages, why not just single SQL across DB? etc. Well, let's first understand the difference between SQL, T-SQL, and PL/SQL, and then we will understand the need for these dialects.
Labels:
interview questions
,
SQL
,
SQL Interview Questions
How to check Perfect number in Java? Example Tutorial
Hello guys, if you are wondering how to check if a given number is a perfect number or not in Java then you have come to the right place. This is one of the interesting coding problem to solve and learn and improve your coding and programming skill. In face, I learned most of my programming by solving these kind of questions. I started with simple ones like factorial, prime number, palindrome, anagram, string permutations before I started solving tree based problems and Dynamic programming problems. These kind of exercise not only give you a chance to get familiar with the programming language constructs like data type, operators, functions, class etc, but also help to build coding sense, which is nothing but your skill to convert your logic into code.
Labels:
coding
,
Coding Interview Question
,
Coding problems
,
core java
,
programming
12 SQL Queries Example and Practice Questions for Tech Interviews
Hello guys, if you are looking for SQL query examples from interviews or SQL Query Practice questions to improve your SQL skill then you have come to the right place. Earlier, I have shared best websites to learn SQL and Practice Query online and in this article, I am going to share 12 popular SQL query examples from interviews. You can also practice them to test your SQL skills before your technical Interview. If you don't know SQL, a short form of Structured Query Language is one of the essential skills in today's programming world. No matter whether you are a Java developer, C++ developer or Python developer, you must know how to write SQL queries. Every programming job interview has at least one or two questions that require you to write SQL queries for a given requirement and many developers struggle there.
Labels:
database
,
interview questions
,
SQL
,
SQL Interview Questions
Why Singleton is Anti Pattern in Java Now and Why you should avoid it? Example
There was a time when the Singleton pattern was the darling pattern of many developers. It's a unique feature to keep certain services available globally, makes it very useful in all kinds of applications. It was also one of the most used design patterns among Java developers. I think the main reason for the Singleton pattern's popularity of designing the application is that there is always one instance of the most important service like Manager and Data Access classes. Still, with the adoption of Dependency injection, Singleton slowly faded away, and now it's considered an anti-pattern in Java applications.
Labels:
core java
,
design patterns
,
programming
Java Stream + map + flatMap + Collectors.toSet() Example Tutorial
Hello guys, I was searching for a good example of flatMap online but didn't
found a good one, so created my own. As name suggest flatMap is used to
flatten stream like unwinding multiple list of values. For example you have a
Stream of List of Integer and you want to create Stream of Integer by
unwinding those list, you can do that using
FlatMap function
from java.util.Stream class. Coming
back to flatMap, its actually a general concept which is available in other
functional programming language like
Scala. Just like map() function works
by applying a function to each element in the Stream, flatMap works by
applying a function that returns a sequence for each element in the list, and
flattening the results into Stream or another list.
Labels:
Java 8
,
Stream API examples
How to Join Two or More Tables in a SQL query? Left Join Example Leetcode Solution
Hello guys, when it comes to combining two tables in SQL, many programmers don't know that they can use the JOIN clause. In fact, JOIN is there to fetch data from multiple tables together. There are mainly two types of joins, INNER Join and OUTER join. On Inner join, only those records have matching values in both tables, while in Outer join, all records from one table are selected in addition to matching records from other tables. There are two kinds of Outer join in SQL, LEFT OUTER JOIN and RIGHT OUTER JOIN. Both are actually the same thing, which means you can get the same result by using either of the outer joins by changing the table's position from left to right.
Labels:
database
,
Leetcode solution
,
SQL
,
SQL Interview Questions
Is CodeGym Good Place to Learn Java? Is CodeGym Premium Worth it?
>Hello guys, if you are learning Java or want to learn Java but not sure if CodeGym is the right place for you or not then you have come to the right place. Earlier, I have shared best places to learn Java coding for FREE and in this article, I will review CodeGym, one of the interactive platform to learn Java. But, Before we see whether CodeGym is worth it for learning and mastering Java, let me tell you a little bit about what CodeGy really is. CodeGym is an excellent and innovative alternative to traditional learning platforms like Udemy and Coursera. It is basically a platform that is designed for young and passionate people who want to learn Java. The CodeGym platform aims to deliver practical learning with the help of games that can make learning fun and interesting.
Labels:
best of javarevisited
,
Codegym
,
core java
,
online resources
How to use Composite Design Pattern in Java? Example Tutorial
Hello Java Programmers, if you want to learn about Composite Design patterns
in Java, like how to implement Composite design pattern and when to use it
then you have come to the right place. Earlier, I have shared the
best Java design pattern courses
and in this article, I am going to talk about Composite design Patterns, one
of the 24 GOF patterns described in the classic
Object Oriented design pattern book. Composite Design Pattern is a
behavioral design pattern from GOF, first described in their classic
book design pattern. The composite pattern allows you to build a structure as
a tree, which contains both leaf and composites.
Labels:
core java
,
design patterns
Top 12 Locking, Synchronization and Multithreading Interview Questions for 5 to 7 Years Experienced Java Programmers
Hello guys, if you are an experienced Java developer say 3 to 5 years or 5 to 7 years experience and preparing for Java Interviews then you very well know that Locking, Synchronization, ConcurrentHashMap, volatile and atomic, compare and swap (CAS), Executor Service, Stream API, and Multithreading in general are quite important and as an experienced Java developer you should be ready for them. In the past, I have shared 50+ Java Multithreading questions, 12 concurrency questions, 21 HashMap questions, and 10 ConcurrentHashMap questions and in this article, I am going to share 10 of my favorite question on Locking, Synchronization and Inter thread communication in Java. If you have been doing Java Interviews then its highly likely that you have already seen this problem but if you haven't you should definitely prepare them.
3 Ways to Learn Web Development in 2023 - Best of Lot
Web development has changed a lot in the recent decade. More and more frameworks and libraries have come out while the older ones are either updated or left out. For example, React and Vue has debuted in the mid-2010s and quickly became popular while AngularJS was completely re-written to survive modern web development. Today, Web development is one of the most popular domains in the IT community. Every company or product wants a website because the web is easily accessible today. Even when mobile applications are gaining popularity, the web remains at the top.
Labels:
best of javarevisited
,
web development
Top 20 System Design Interview Questions with Answer for 1 to 3 Years Experienced
Hello guys, if you are preparing for FAANG or any Software developer Job Interview on Startup or a Tech company like Spotify, Flipkart, or Zoom but worried about System design questions then you are not alone. System design is an intimidating topic and requires a lot of study and experience to design a real world system. While it's not a rocket science the knowledge of different system design components and concepts are hard to acquire. In the past, I have shared best System Design Courses and best Software architecture courses as both are related to each other and in this article, I am going to share 20 System Design Interview Questions with answers for programmers with zero to 3 years of experience.
Labels:
interview questions
,
System Design
Subscribe to:
Posts
(
Atom
)