please help!
ASAP ASAP ASAP
thanks!
Attachments:
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
Physics,
1 month ago
Math,
1 month ago
English,
1 month ago
Social Sciences,
2 months ago
Computer Science,
2 months ago
Hindi,
9 months ago
Geography,
9 months ago