Primitive type casting in Java

In Java, primitive type casting is converting one primitive data type into another.It’s split into two categories: widening (implicit) and narrowing (explicit) casting. 1. Widening Casting (Implicit) Also called type promotion — smaller types automatically convert to larger types without data loss. Order of promotion:byte → short → int → long → float →…

0 Comments

Pass by value vs pass by reference for methods in Java

In Java, when you talk about "pass by value" vs "pass by reference" for methods, the key point is: Java is always pass-by-value — but what is passed by value depends on the type of variable. 1. Pass-by-Value (for primitives) When you pass a primitive type (int, double, char, boolean, etc.) to a method:…

0 Comments

Wrapper classes in Java

In Java, wrapper classes are special classes that let you treat primitive data types as objects. They "wrap" a primitive value in an object so it can be used where an object is required (for example, in collections like ArrayList that can’t store primitives directly). 1. Primitive Types & Their Wrapper Classes Primitive typeWrapper…

0 Comments

Adding Interceptors to WebClient in Spring Boot

In Spring Boot applications, WebClient is a powerful tool for making HTTP requests to external services. However, sometimes you need to intercept and modify these requests or responses for various reasons such as logging, authentication, or adding custom headers. This is where interceptors come into play. Interceptors allow you to intercept and manipulate the…

0 Comments

Understanding BeanCreationException in Spring Boot

Spring Boot, a popular framework for building Java applications, is known for its robust dependency injection (DI) capabilities. This DI mechanism allows Spring to manage the lifecycle and dependencies of beans—objects that are instantiated, assembled, and otherwise managed by the Spring IoC (Inversion of Control) container. However, during the initialization phase, you might encounter…

0 Comments

TypeScript Variables: A Comprehensive Guide with Examples

In TypeScript, variables are used to store data values. They play a crucial role in programming by allowing developers to manipulate and work with data dynamically. In this tutorial, we'll explore the fundamentals of variables in TypeScript, including their types, declarations, and usage. Variable Declarations In TypeScript, you can declare variables using three keywords:…

0 Comments

End of content

No more pages to load