"Object-Oriented Programming in Unity" was retired on August 1, 2018.

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

i dont know how to start typing my code in challenge taker .

after your video is finished and u get a chance to practice your codes. there is an option called challenge taker to practice your code. how can i start writing my codes??

Name.java
// I have setup a java.io.Console object for you named console
console.out.printf("My name is Rafia");

1 Answer

Michael Hess
Michael Hess
24,512 Points

Hi Rafya,

It looks like there was not a string firstName with your name assigned to it.

1) First, create a String variable called firstName and assign the variable your first name.

2) Print "Rafya can code in Java!" using conole.printf

3) Print your name by using %s and the firstName variable using conole.printf

// I have setup a java.io.Console object for you named console

String firstName = "Rafya"; //task 1

console.printf("Rafya can code in Java!"); //task 2

//console.printf("%s can code in Java!",firstName); //task 3

If you have any questions I'll be happy to answer them.