Give the example of mixing data type in java?
Mixing Data Types
Order can form a difference while data types are mixed. For example,
1 / 2 * 3.5 = 0.0
3.5 * 1 / 2 = 1.75
3.5 / 2 = 1.75
You cannot assume in which the usual mathematical laws of commutativity apply while mixing data types, especially integer and floating point types.
1.0 / 2 * 3.5 = 1.75
3.5 * 1.0 / 2 = 1.75
1 / 2.0 * 3.5 = 1.75
3.5 * 1.0 / 2.0 = 1.75