|
Would final String charData = 3.14159265; work? A good answer might be:No: charData is an object of type String and 3.14159265 (without the quotes around it) is a literal of primitive type double. The style of using bit patterns is completely different, and a simple assignment statement won't work. |
How the Program WorksThe characters "3.14159265" are contained inside String charData.
The assignment statement works in its usual two steps:
Usually this is called converting from character data to double precision floating point. But in reality the character data remains unaltered; a floating point value is calculated from it, but it does not change. |
QUESTION 3:Would the program work if the declaration of charData were changed to:
Click Here after you have answered the question
|