realNameHidden

realNameHidden @realnamehidden1_61

About: Actively Looking For Work Youtube Channel Link : https://www.youtube.com/@realNameHiddenn Blog : https://idiotprogrammern.blogspot.com/

Location:
India
Joined:
Oct 23, 2021

realNameHidden
articles - 161 total

how to use RestTemplate in a Spring Boot application to make an HTTP GET request

✅ What is RestTemplate? RestTemplate is a synchronous client to perform HTTP requests in a Spring...

Learn More 5 1May 3

How to read Query Param in Spring Boot

Create Project with Spring Web Dependency Directory Structure: pom.xml <?xml version="1.0"...

Learn More 5 0May 3

@Qualifier Example in Spring Boot

In Spring, when you have multiple beans of the same type, Spring gets confused about which one to...

Learn More 0 0Apr 19

@ControllerAdvice and @ExceptionHandler Annotations Spring Boot

Exception Handling in Spring Boot — A Simple Example 🚀 Spring Boot provides multiple ways to handle...

Learn More 9 0Mar 29

@Bean annotation example in spring boot

Directory Structure pom.xml <?xml version="1.0" encoding="UTF-8"?> <project...

Learn More 7 0Mar 15

Example of @Async in Spring Boot for Beginners

The @async annotation in Spring Boot allows you to run tasks asynchronously (in the background)...

Learn More 5 0Mar 9

any() method in Mockito Spring Boot example

The any() method in Mockito is used as a matcher to specify that any value of a given type can be...

Learn More 5 0Feb 23

doNothing()method example Spring Boot

When to Use doNothing()? When testing void methods that perform side effects (e.g., sending emails,...

Learn More 6 0Feb 16

doReturn() method in Mockito example

Spring Boot Example Using doReturn() in Mockito The doReturn() method in Mockito is used when you...

Learn More 6 0Feb 8

thenThrow() method in Mockito example

Scenario: Mocking a Service to Throw an Exception for Testing Error Handling in a Controller 1....

Learn More 6 0Feb 1

thenReturn() method in Mockito example

Scenario: Mocking a Service to Test a Controller Application Code Employee.java package...

Learn More 5 0Jan 26

when() method in Mockito example

Spring Boot example demonstrating the use of when() in unit testing with Mockito. The example covers...

Learn More 6 0Jan 18

verify() method in Mockito example

The verify() method in Mockito is used to confirm that specific interactions with mocked objects...

Learn More 6 0Jan 12

List.of() vs Arrays.asList() in java

When working with Java, both List.of() (introduced in Java 9) and Arrays.asList() (available since...

Learn More 7 0Jan 5

@PreConstruct and @PostConstruct annotation Spring Boot Example

@PostConstruct: This method is called after the Spring bean (in this case, ExampleBean) has been...

Learn More 6 1Jan 5

With Spring can I make an optional path variable?

Yes, you can make a path variable optional in Spring by using @PathVariable with the required...

Learn More 8 0Dec 28 '24

Java Stream Scenario Based Interview Question

You have a list of employees with fields like name, age, and department. Write a code snippet to...

Learn More 7 0Dec 25 '24

Java scenario based interview questions

You have a list of strings: ["apple", "banana", "cherry", "date", "fig", "grape"]. Write a code...

Learn More 9 0Dec 15 '24

How does Optional.ifPresent() differ from Optional.orElse()?

Optional.ifPresent() and Optional.orElse() are two methods in Java's Optional class, designed to...

Learn More 6 0Dec 15 '24

How does the limit() method differ from the skip() method in streams?

The limit() and skip() methods in Java Streams are used to control the number of elements in a...

Learn More 7 0Dec 8 '24

Java Streams | What is the difference between sorted() and distinct() in streams?

For Explanation watch video sorted() The sorted() method is used to sort the elements of a...

Learn More 10 1Dec 7 '24

How does reduce() differ from collect() in Java streams?

The reduce() and collect() methods in Java Streams serve different purposes and operate at different...

Learn More 7 1Nov 30 '24

Java’s TreeMap.tailMap() Method Explained

For Explanation watch Understanding TreeMap.tailMap() in Detail The TreeMap.tailMap() method in...

Learn More 6 2Nov 20 '24

Java Stream.distinct()

The Stream.distinct() method in Java is used to filter out duplicate elements from a stream, ensuring...

Learn More 6 0Nov 17 '24

What is the difference between forEach and map in streams?

forEach: A terminal operation that performs an action on each element of the stream but does not...

Learn More 9 0Nov 10 '24

Java 8 Stream API limit() and skip() methods

In Java 8, the Stream API provides limit() and skip() methods for controlling the number of elements...

Learn More 7 0Nov 2 '24

Write a Java program to find duplicate elements in an array

for explanation watch video Find Duplicates using HashSet import java.util.HashSet; public...

Learn More 6 0Nov 1 '24

Should try-catch be written inside or outside the for loop? And state your reasons.

Whether to write a try-catch block inside or outside a for loop depends on the use case and the...

Learn More 8 1Oct 20 '24

how to call put method using RestTemplate Spring Boot

For Explanation watch video Producer App Employee package com.example.demo.entity; import...

Learn More 6 0Oct 18 '24

Find the Duplicate Elements in an Array/List

Given an array of integers, find all the elements that are duplicated. Example: Input: [1, 2, 3, 4,...

Learn More 7 0Oct 6 '24