Computer Applications
Which of the following type conversions in Java will result in a loss of precision?
Values & Data Types Java
2 Likes
Answer
double
to int
Reason — A double
may have a fractional part, which is truncated when converting to int
, resulting in a loss of precision.
Answered By
3 Likes
Related Questions
The size of '\n' is:
- 2 bytes
- 4 bytes
- 8 bytes
- 16 bytes
Assertion (A): The
boolean
data type in Java can have only two possible values:true
orfalse
.Reason (R): Boolean values in Java are stored as integers, with
true
represented by 1 andfalse
by 0.The number of bytes occupied by a character array of four rows and three columns are:
- 12
- 24
- 96
- 48
The default value of a boolean variable is:
- False
- 0
- false
- True