In java Numeric have 2 categories - Integer and Floating. For Integer default value is int whereas for floating the default value is double.
So to declare and initialize a float variable you need to use:
float floatVar=10.0F;
Here use of F or f postfix is mandatory as by default the value will be treated as double.
While to declare and initialize integer long you can use:
long longVar=10L; or long longVar=10;
The above is consistent with floating variables as default is considered as int so you need to tell compiler that treat this as long value not as int. Also as int is subset of long so without using L or l as postfix is acceptable.
Now say you need to declare and initialize a short variable you can use:
short shortVar=10;
Here there is no need to use anything as postfix to tell compiler that treat it as a short variable value rather than default int value. I understand that the value is within the range of short variable's defined range and I also understand implicit casting when the destination is larger to hold the value. But why there is inconsistent behavior when dealing with integral and floating variables?