Computer Applications
How can you convert a numeric value enclosed in a string format ?
Java String Handling
3 Likes
Answer
We can convert a numeric value enclosed in a string format into a numeric value by using valueOf() method.
For example, the given statement will return the numeric value of the String argument "15".
int num = Integer.valueOf("15");
Answered By
3 Likes
Related Questions
What are String and StringBuffer classes of Java?
How are Strings different from StringBuffers ?
Write the return type of the following library functions:
- isLetterOrDigit(char)
- replace(char, char)
State the data type and values of a and b after the following segment is executed:
String s1 = "Computer", s2 = "Applications" a = (s1.compareTo(s2)); b = (s1.equals(s2));