Advertisements
Advertisements
Question
Differentiate between parselnt() and toString() functions.
Distinguish Between
Solution
Sr. No. | parselnt() functions | toString() functions |
1. | This method in the Integer wrapper class converts a string to an integer. | This method in the Integer wrapper class converts a basic data type (int) to a string data type. |
2. | Example:
|
Example:
Now that s has the value "24", mathematical operations cannot be performed on it. |
shaalaa.com
Is there an error in this question or solution?
Chapter 2: Library Classes - EXERCISES [Page 179]