Computer Applications
Which of the following type conversions in Java will result in a loss of precision?
Values & Data Types Java
1 Like
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
2 Likes
Related Questions
The default value of a boolean variable is:
- False
- 0
- false
- True
The number of bytes occupied by a character array of four rows and three columns are:
- 12
- 24
- 96
- 48
Consider the array given below:
char ch[] = {'A','E','I','O', 'U'};Write the output of the following statements:
System.out.println(ch[0]*2);:- 65
- 130
- 'A'
- 0