please help!
ASAP ASAP ASAP
thanks!
Attachments:
![](https://hi-static.z-dn.net/files/dfb/109f27010ce15b60f65b4b3d53489526.jpg)
Answers
Answered by
5
Given Códe:-
String s="1001";
int x=Integer.valueOf(s);
double y=Double.valueOf(s);
System.out.println("x="+x);
System.out.println("y="+y);
Required Output:-
1001
1001.0
Explaination:-
valueOf() returns the integer number present in the string.
Note:-
- If you write s="A" then you will get NumberFormatException because A is alphanumeric.
Similar questions
Political Science,
2 months ago
Math,
2 months ago
Environmental Sciences,
2 months ago
Social Sciences,
4 months ago
Computer Science,
4 months ago
Hindi,
11 months ago
Geography,
11 months ago