Computer Applications
State the method that:
(i) converts a string to a primitive float data type.
(ii) determines if the specified character is an uppercase character.
Java String Handling
2 Likes
Answer
(i) Float.parseFloat()
(ii) Character.isUpperCase()
Answered By
1 Like
Related Questions
What will the following code output:
String s = "malayalam"; System.out.println(s.indexOf('m')); System.out.println(s.lastIndexOf('m'));
What will be the output of the following code snippet when combined with suitable declarations and run?
StringBuffer city = new StringBuffer("Madras"); StringBuffer string = new StringBuffer( ); string.append(new String(city)); string.insert(0, "Central "); String.out.println(string);
What will be the output for the following program segment?
String s = new String ("abc"); System.out.println(s.toUpperCase( ));
If:
String x = "Computer"; String y = "Applications";
What do the following functions return?
(i) System.out.println(x.substring(1,5));
(ii) System.out.println(x.indexOf(x.charAt(4)));
(iii) System.out.println(y + x.substring(5));
(iv) System.out.println(x.equals(y));