Concatenating Strings in Java





The interactive transcript could not be loaded.



Rating is available when the video has been rented.
This feature is not available right now. Please try again later.
Published on Mar 13, 2012

Writing a function to iterate over a string and use concatenation to build a new string with only some of the original parts.

1) What is the name of my function?

2) What is the return type of my function?

3) What is the parameter of the function?

4) What is the purpose of the string s?

5) Why do I count by 2's in my for loop?

6) How many letters at a time are accessed by my substring method?

7) What is concatenation?

8) What are the two options in main when calling a value returning function mentioned in this video?

9) What value would a call to EveryOther return if it were passed the parameter "narwhal"?

10) Write a modified version of the function (yes, the whole thing) that prints the OTHER every other letters (i.e. skips the first).

Comments are disabled for this video.
When autoplay is enabled, a suggested video will automatically play next.

Up next

to add this to Watch Later

Add to

Loading playlists...