Java: String Exercises 1
Name __________________________________________
(10 points) Given the following local variable declarations:
String a = "abc";
String s = a;
String t;
What is the value of the following expressions (or ERROR)?
- __________
s.length() - __________
t.length() - __________
1 + a - __________
a.toUpperCase() - __________
"Tomorrow".indexOf("r") - __________
"Tomorrow".lastIndexOf('o') - __________
"Tomorrow".substring(2,4) -
[an error occurred while processing this directive]
__________
(a.length() + a).startsWith("a") - __________
s == a - __________
a.substring(1,3).equals("bc")
















Current Comments
0 comments so far (post your own) View All Comments Latest 10 Comments: