It's not a secret anymore!
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
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: 20517

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
jQuery in Action, 3rd edition