Topics
|
Index
|
Exercises
|
Search
|
About
|
Help
|
Contact Us
Typecast
Compute
100/3
.
Download files:
TypeCast.java
Areas:
Primitive types.
TypeCast.java
1
float result;
2
result = 100 / 3;
3
System.out.println("result = " + result);
Question 1
What is the value of result after line 2?
Question 2
Is the following expression more accurate:
result = (float)(100 / 3);
?
Question 3
How can you change the expression to get a more accurate result?