This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

use of '\f' ?

 
Ken Ng
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
Can anybody explain what exactly is '\f' (form feed).
What practical situations do we use it?
How to use it? Care to give some examples
Thank for the ans.
 
Howard Kushner
author
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure. When used in a string that will be directed to a printer, it causes the succeeding output to begin on a new page, so it is like a page eject. It instructs the printer to begin the next output on a new page even if the previous page is not yet completely full. Does that help.?
For example:
"ABC\nDEF\nGHI\fXYZ"
will print ABC on the first line, DEF one the second line, GHI on the third line, and XYZ at the top of the next page.
-------
ABC
DEF
GHI

-------
XYZ
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic