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 Getting Started with Java Strings, Variables, and Formatting

what is the java name for it

can i name it jared

Name.java
// I have setup a java.io.Console object for you named console
Aaron Arkie
Aaron Arkie
5,345 Points

Hello Jared! In this exercise you are creating a String object to hold well... a String! You can assign it anything you want as long as it is a String! For example:

//this is a String object in action.

String name = "Aaron"; // We are creating a variable called name to hold the string.

console.printf(name); // This line allows the variable to be displayed to the console.

Here is an exercise for you! Rearrange the following code to the above format to see if you understand. Delete and use correct symbols.

variableName String equals "your name goes here!";
console.printf(variableName);

Hope this helps.

1 Answer

It looks like you can't name it that, because Craig has already added it, but in a workspace you could change

Console console = System.console();

to

Console jared = System.console();

But then you would have to type:

jared.printf(" ");

Instead of:

console.printf(" ");

I hope it makes sense, ISAIAH S