This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes printf formatting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "printf formatting" Watch "printf formatting" New topic

printf formatting

O. Ziggy
Ranch Hand

Joined: Oct 02, 2005
Posts: 430

In the following line of code

What is does the %n mean?

I saw the above example in code examples in
Henry Wong

Joined: Sep 28, 2004
Posts: 20374

It's all explained, in the JavaDoc of the java.util.Formatter class, which is the class that is used to format the text.


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
John Stark
Ranch Hand

Joined: Jul 19, 2011
Posts: 185
I think it prints a newline.

I agree. Here's the link:
subject: printf formatting
It's not a secret anymore!