Introducing Double

The Double class is part of the java.lang package.

The Double class is a wrapper class for the primitive type double. It contains several methods to deal with double type values effectively. An object of Double class can hold a single double value.

Creating a Double object

This class has two constructors:

  • Double (double value)
  • Double (String string)

Let’s cover them one by one.

The Double (double value) constructor

This constructor constructs a new Double object that represents the specified double value.

Look at the program below.

Get hands-on with 1200+ tech skills courses.