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

Java Java Basics Using your New Tools Multiple Format Strings

Abdulrahman Mousa
Abdulrahman Mousa
2,276 Points

Create a new variable to store a past tense verb, so in camel case that is pastTenseVerb. Accept input from the console

this is the question what should we do

Multiple.java
// I've imported java.io.Console for you.  It is stored in a variable called console for you.
String name = console.readLine("abdulrahman: ");
String name = console.readLine("enter your adjective here: ");

3 Answers

Insert a new line of code, like the previous ones, but this time ask for a verb (so the prompt text would be something like "enter a past tense verb: "). And store it in a String type variable, just like before, but name it pastTenseVerb.

Abdulrahman Mousa
Abdulrahman Mousa
2,276 Points

ow you mean it should be like this:String pastTenseVerb = console.readLine("abdulrahman: "); the string should be pastence verb (thank you very much)

Abdulrahman Mousa
Abdulrahman Mousa
2,276 Points

ow you mean it should be like this:String pastTenseVerb = console.readLine("abdulrahman: "); the string should be pastence verb thanks thank you very much

Inside the braces after console.readLine() is the prompt text what appears when you run the program. What you type in as answer to the console will be stored in the name, adjective, etc. variables. So e.g. the program will first ask you 'enter your name here: ', then you type in e.g. 'Abdulrahman', and that will be the value of the name variable, then the second prompt appears, asking 'enter an adjective here: ', for which you could type in e.g. 'good', which will be stored in the adjective variable, and so on.

String name = console.readLine("enter your name here: ");
String adjective = console.readLine("enter an adjective here: ");
String pastTenseVerb = console.readLine("enter a past tense verb here: ");