wood burning stoves 2.0*
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "printf formatting" Watch "printf formatting" New topic
Author

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 http://www.particle.kth.se/~lindsey/JavaCourse/Book/Part1/Tech/Chapter05/formatterPrintf.html
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18534
    
  40

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

Henry


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.

John
 
Consider Paul's rocket mass heater.
 
subject: printf formatting
 
Similar Threads
Escape sequence
Java Recursion and binary tree searching questions
a problem with Palindromes please help..
Java Questions in Interview
Displaying others variables in a String