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 trial3 Answers
Tonnie Fanadez
UX Design Techdegree Graduate 22,796 Points%d is used in Strings formatting using printf() method.
It means that an int value is expected at that position in the string, the value of the int is specified after comma
e.g. System.out.printf("Michael has %d dollars and %d lamborghinis.", 50, 7);
You will the output on the console as:
Michael has 50 dollars and 7 lamborghinis.
You can also throw in a %s there if you like.
System.out.printf("%s has %d dollars and %d lamborghinis.", "Michael", 90, 4);
This will give you this:
Michael has 90 dollars and 4 lamborghinis.
<noob />
17,062 Pointslol u were sarcastic
<noob />
17,062 PointsHi, i have answered this question on ur previous theard. make this answer best answer as well XD
Tonnie Fanadez
UX Design Techdegree Graduate 22,796 Pointsnoob developer .... by the way who decides whether an answer is a best a answer
michael lee
5,179 Pointsthe person who started the discussion can decide .
Tonnie Fanadez
UX Design Techdegree Graduate 22,796 PointsTonnie Fanadez
UX Design Techdegree Graduate 22,796 PointsSeriously noob developer I didn't know who votes for the best answer, personally I have never voted any reply as a best answer but some of my answers have been voted for.