What is the default value of float and double datatype in Java?

Started by johnmecanse34, 11-20-2013, 02:48:31

Previous topic - Next topic

johnmecanse34Topic starter

Hi,


What is the default value of float and double datatype in Java?

Its my interview question  anyone know the correct answer?

anyone..
  •  


xerbotdev

I assume you are talking about Javascript as you have posted in the Javascript subforum. Java is a completely separate language.

Javascript only has "number", no float/double like in C or C++. The Javascript number is a 64bit floating point number, that means, it is equivalent to a double on most operating systems.
Xerbot Website [nofollow]
  •  


uditsh

Quote from: johnmecanse34 on 11-20-2013, 02:48:31

What is the default value of float and double datatype in Java?


Default value of data type in JAVA:

float: 0.0f

double: 0.0d
  •