Write a statement for each of the following: (3)
i)store a number 275 as a String.
ii)Convert the string to a numeric value.
iii) Add it to the existing total of 1000 to update the total.
Answers
Answered by
1
Answer:
(i)
_____
(ii)
_____
(iii)
Remember:-
- Integer.toString() converts integer to string.
- Integer.parseInt() or Integer.valueOf() converts String to integer.
- It must be kept in mind that the string should not contain any alphanumeric characters otherwise it will throw NumberFormatException
Similar questions