In a Java program, Rajat wants to use a variable to store the quantity of an item which may be in whole numbers or decimals. Write a suitable Java statement to declare the variable for the above mentioned purpose.

4 views

1 Answers

He can use float or double type od variable. double num;

or

float num;

4 views