Ask Questions?

View Latest Questions

Advertisement


 
 

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

Java: String Exercise 1c

Name ______________________

Assume the following:

String a = "Adios";
String h = "Hasta luego";

Give the values of the following expressions.

1____________a.length()
2____________a.substring(3)
3____________a.substring(1,2)
4____________"yesterday".substring(4).length()
5____________h.substring(1, 4)..substring(1).toUpperCase()

6____________h.indexOf("e")
7____________"I've been seen".lastIndexOf("e")
8____________"Length=" + a.length()
9____________(a.substring(2, 4) + h.substring(3, 5)).toUpperCase()
10____________h.substring(0, h.indexOf(" ")).toLowerCase()
Advertisement


DMCA.com