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
English,
9 days ago
Chemistry,
9 days ago
Social Sciences,
19 days ago
Computer Science,
19 days ago
Hindi,
8 months ago
Geography,
8 months ago