Hello,
A simple question indeed; but of course, a conceptual one.
Well, a data type is a particular kind of data item, as defined by the values it can take, the programming language used, or the operations that can be performed on it. Example - integer, character, float, double, etc.
Now, in Java, the default values of float and double are as below.
Float - 0.0f
Double - 0.0d
You can verify the same by running the below program.
public class DefaultValue
{
static double d;
static float f;
public static void main(String[] args)
{
System.out.println("Double :" + d);
System.out.println("Float :" + f);
}
}
Output:
Hope by now, you are confident with the default values of float and double in Java.