Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build an Interactive Story App The Rest of the Story Adding Story Pages

Jasper Allijn
Jasper Allijn
2,743 Points

We want to format the 'jokeText' String to include the value of the 'animal' variable.

I have no idea what I need to do here.

String animal = "monkey";
jokeText = String.format(, );
mTextView.setText(jokeText);

What I did was:

String animal = "monkey";
jokeText = String.format(jokeText, animal);
mTextView.setText(jokeText);

But I keep getting the incorrect message. Am I missing something?

1 Answer

It seems like you are just trying to set jokeText to the same as animal, in which case this would work:

jokeText = animal;

If say you wanted jokeText to have a value of "The animal is a monkey" you would do this:

jokeText = String.format("The animal is a %s", animal);

The value of animal will replace %s and return the String "The animal is a monkey"