Skip to content
Advertisement

Tag: double

Java double initialization

In what way are these statements different? double dummy = 0; double dummy = 0.0; double dummy = 0.0d; double dummy = 0.0D; Answer Having tried a simple program (using both 0 and 100, to show the difference between “special” constants and general ones) the Sun Java 6 compiler will output the same bytecode for both 1 and 2 (cases

Advertisement