Administrator

Lokesh Gupta

A fun-loving family man, passionate about computers and problem-solving, with over 15 years of experience in Java and related technologies. An avid Sci-Fi movie enthusiast and a fan of Christopher Nolan and Quentin Tarantino.

Website: https://howtodoinjava.com

Github: https://github.com/lokeshgupta1981/

Twitter: @HowToDoInJAVA

LinkedIn: https://www.linkedin.com/in/lokeshgupta1981/

My Articles:

Spring ProblemDetail and ErrorResponse

Starting since Spring 6 and Spring Boot 3, the Spring Framework supports the “Problem Details for HTTP APIs” specification, RFC 7807. This Spring tutorial will guide you through this new enhancement in detail. 1. Problem Details Specification [RFC 7807] This RFC defines simple JSON and XML document formats that can …

TypeScript Date

Learn to create new Date objects in TypeScript, and modify, compare and format them to custom and inbuilt locale-specific patterns.

JMH – Java Microbenchmark Harness

Java Microbenchmark Harness (JMH) is a tool that allows measuring various code performance characteristics and identifying bottlenecks with precision – up to the method level.

Spring @Lookup Method Injection

Spring lookup method injection is the container’s ability to override methods on container-managed beans and return another container-managed bean.

Spring: Injecting Prototype Bean into Singleton Bean

Spring context supports singleton and prototype bean scopes along with four other scopes specific to the web context. The singleton is the default bean scope. A common problem arises when we want to inject a prototype-scoped bean into a singleton-scoped bean. In this case, as the singleton bean is initialized …

Java Reserved and Contextual Keywords

Java has 51 reserved words and 16 contextual keywords that cannot be used as identifiers in the code. Programmers should not use these keywords for other purposes.

Java IO (Input/Output) Tutorials

Java IO is a collection of APIs targeted at reading and writing data from various sources to several targets. For example, we can read data from a file or over a network, write to a file or write a response back over the network. This page categorizes the various IO-related common tasks …

Spring Tutorials

Spring helps write high-performing, easily testable, and reusable code and promotes programming best practices by applying dependency injection (DI).

Spring MVC

Spring WebMVC (or Spring MVC) contains Spring’s model-view-controller (MVC) and REST Web Services implementation for web applications.

Spring Batch Tutorial

Spring batch is a lightweight, comprehensive framework designed for the development of robust batch processing applications. Learn with examples.

JUnit 5 XML Report Example

Learn about the JUnit XML report generation in legacy and new open test reporting formats and switching a specific version using the configuration parameters.

What’s New in Spring 6 and Spring Boot 3

Learn about the new features and changes introduced in Spring 6 and Spring boot 3 such as baseline upgrade to Java 17 and removing all deprecated classes, methods and properties.

Java String Tutorial

Java String class examples. Learn to create strings, methods, comparisons, formatting and various conversions with simple and easy to follow Java examples.

Java 8 Stream – Collectors GroupingBy with Examples

Learn to use Collectors.groupingBy() method to group and aggregate the Stream elements similar to ‘GROUP BY‘ clause in the SQL. Stream -> groupingBy() -> Map of elements after applying ‘group by’ operation 1. Collectors.groupingBy() Method 1.1. Syntax The groupingBy() method returns a Collector implementing a “GROUP BY” operation on Stream …

How to Flatten a Nested List in Java

Flattening a nested list may seem hard at the beginning, but it’s not. It can be easily done using only plain Java, streams, or external libraries.

Interview Guide

These articles will help you prepare for the next interview with more confidence. We have tried to put as much reasoning as possible in each question. Feel free to suggest more questions and guides. 1. Java Interview Questions 2. Spring Interview Questions 3. More Questions Happy Learning !!

Spring Boot Filter: with Order and URL Pattern Examples

In this Spring boot tutorial, we will learn to create, order and register servlet filters in different ways including Filter interface, @WebFilter annotation and inbuilt filter bean classes. 1. Introduction In a web application, we must implement the javax.servlet.Filter interface (jakarta.servlet.Filter in Spring Boot 3) to create filters that can …

Maven Tutorials

Maven is a build tool based on POM and is generally used for Java projects to automatically download the project dependencies in build time.

Running JUnit Tests with Maven

Learn to run JUnit tests using Maven Surefire Plugin. We will learn to run a single test, run only selected tests or run all the tests in the project.

Convert an Object to Map in Java

Learn to convert a given Java object into a Map using different solutions including Jackson ObjectMapper, Gson and Java reflection.

TypeScript Tutorial

TypeScript is an open-source programming language that was developed and maintained by Microsoft in 2012. TypeScript brings ‘types’ (or datatypes) to JavaScript making a strongly typed language. This page lists down all the TypeScript tutorials posted on this blog for easy navigation. 1. TypeScript Basics 2. TypeScript Types 3. TypeScript …

Format Output with Java Printf

Learn to print formatted output in Java using the format() and printf() methods. Learn to format strings, date-time, floats with precision.

SQL Interview Questions with Answers

This guide lists out a few of the most asked SQL interview questions and gives their answers such as JOINS, KEYWORDS, TRIGGERS and much more.

XmlUnit Tutorial with Examples

In XmlUnit 2.x tutorial, learn to create different XML sources, normalizing with decorators and comparing for identical, similar and XPaths.

Guide to JSONassert (with Examples)

Learn to write test result assertions using the JSONassert with easy-to-understand examples. We can use this tutorial as JSONassert cookbook for quick reference.

About Us

HowToDoInJava provides tutorials and how-to guides on Java and related technologies.

It also shares the best practices, algorithms & solutions and frequently asked interview questions.