Ask Questions?

View Latest Questions

Advertisement


 
 

Java: String Exercise 1a
Posted on: April 17, 2011 at 12:00 AM
This page discusses - Java: String Exercise 1a

Java: String Exercise 1a

Name ______________________

Assume the following:

String h, a;
h = "Hello";
a = "abc";

Give the values of the following expressions.

1__________h.length()
2__________h.substring(2, 3)
3__________h.substring(1)
4__________h.toUpperCase()
5__________h.toUpperCase().toLowerCase()
6__________h.indexOf("H")
7__________h.indexOf("h")
8__________"Tomorrow".indexOf("o")
9__________"Tomorrow".lastIndexOf("o")
10__________"Ans: " + 1 + 2
11__________a.length() + a
12__________h.substring(0, h.length())
Advertisement


DMCA.com