Wrapper Classes in Java

In this tutorial, I am going to explain what are wrapper classes in java. Why it is introduced and the concept of autoboxing and unboxing.

Wrapper Class

As the name suggests, a wrapper class wraps (encloses) around a primitive data type and gives it an object appearance. In simple words, we can convert primitive data types into an object using their corresponding wrapper class.

Wrapper classes are final and immutable.

How to create immutable class in java

For example:

Primitive Data Type

A primitive data type defines the size and type of variable values. In Java, we have eight primitive data types, which are as follows:

How to Create Immutable Class in Java

In this tutorial, I am going to discuss what is immutable classes in java? How to create custom immutable class in java.

What is immutable class?

Immutable class means, once you created an object of a class you can’t change it’s state or attribute value. In Java, all the wrapper classes like Boolean, Short, Integer, Long, Float, Double, Byte, Char and String classes are the immutable class.

In Effective java, Joshua Bloch makes this compelling recommendation.


“Classes should be immutable unless there’s a very good reason to make them mutable….If a class cannot be made immutable, limit its mutability as much as possible.”

Multiply Two Numbers without using * (Multiplication Operator)

Write a C program to multiply two numbers without using * multiplication operator.

Given two numbers, both numbers are positive.  Write a program to multiply two numbers without using * multiplication operator.  This problem is bit tricky as we are not allowed to use multiplication operator .

We can use multiple approaches to solve this problem. In this tutorial, i am going to explain how to multiply two numbers using recursion as well as using iterative approach.

C Program to Multiply Two Numbers without using *

C Program to Multiply Two Numbers without using *