Question: Tutorial - Strings, OO Concepts Strings 1. Evaluate the following expressions. For those methods not covered in lectures, use the API to discover how they

Tutorial - Strings, OO Concepts

Strings

1. Evaluate the following expressions. For those methods not covered in lectures,

use the API to discover how they work (a "learning to learn" Graduate Quality

2).

a. "y" + 2 + 3

b. "y" + (3 + 4)

c. 2 + 3 + "y"

d. 2 + (3 + "y")

e. "y" + (2 + 3) + "z"

f. "y" + 2 + 3 + "z"

g. "Luct".length( )

h. " Luct ".charAt(3)

i. " Luct ".replace('u', 'k')

j. " Luct ".substring(1, 3)

k. " Luct ".substring(2)

l. " Luct ".equalsIgnoreCase("luct")

2. Explain how the implementation of substring(int beginIndex) would

take advantage of substring(int beginIndex, int endIndex).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!