Computer Applications
What will be the output when the following code segments are executed?
(i)
String s = "1001";
int x = Integer.valueOf(s);
double y = Double.valueOf(s);
System.out.println("x="+x);
System.out.println("y="+y);
(ii)
System.out.println("The king said \"Begin at the beginning!\" to me.");
Related Questions
The method to convert a String to double is:
- String.toDouble()
- Double.Parsedouble()
- Double.parseDouble(String)
- Double.parseDouble()
State the data type and value of res after the following is executed:
char ch = '9'; res= Character.isDigit(ch);What is the method to check whether a character is a letter or digit?
- isDigit(char)
- isLetterOrDigit()
- isLetterOrDigit(char)
- isLETTERorDIGIT(char)
Give the output of the following code:
String P = "20", Q ="19"; int a = Integer.parseInt(P); int b = Integer.valueOf(Q); System.out.println(a+""+b);