Skip to content
Advertisement

How come declaring something as a double data type would lead the ide to think it is a integer?

I am very confused on how a declared double data type would lead to the intellij ide to believe I was requiring a int to declare. Can someone give me some insight on this?

Here is the code in a picture: enter image description here

Advertisement

Answer

Double Data type :

The double data type is a double-precision 64-bit IEEE 754 floating point. Its value range is unlimited. The double data type is generally used for decimal values just like float. The double data type also should never be used for precise values, such as currency. Its default value is 0.0d.

Example: double d1 = 12.3

Double[] yu=new Double[cholo]

you are trying to declare an array of size double which can be floating, so you should declare an integer in the [], As it indicates the number of the element you want to store of type double.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement