[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 582
  • Last Modified:

white space in java

Hi,

I am reading as below from link

According to the JavaSW Language Specification, whitespace in Java consists of the ASCII space character (SP), the ASCII horizontal tab character (HT), the ASCII formfeed character (FF), and line terminators.

Line terminators consist of the ASCII newline character (LF), the ASCII carriage return character (CR), and the ASCII carriage return character followed by the ASCII newline character.


--------------------------------------------------------------------------------
 


http://www.avajava.com/tutorials/lessons/what-is-considered-whitespace.html

I have not understood what author meant.

Can you please advise.
Is there is a example to demonstrate this concept.
please advise
Any links resources ideas highly appreciated. Thanks in advance
0
gudii9
Asked:
gudii9
2 Solutions
 
hcoragemCommented:
All these ASCII codes are an heritage from the time of the Teletype machine, but they are still being used on our printers and screen with almost the same effect.

LF - Line Feed
CR - carrier return
FF - Form Feed
HT - Horizontal Tab

All these codes are invisible, they just produce an action to position the next character to be printed.
Only the ASCII SP (space) code produced by the space bar on the keyboard is visible, otherwise we would see  allthewordsmixedtogheter.
0
 
gudii9Author Commented:
What is difference between Line Feed and Form Feed. Please advise
0
 
Smart_KidCommented:
\r - 0x0D - CR - Carraige return
Move to the leading end (left) of the current line.

\n - 0x0A - LF - Line Feed
Move to next line.

\f - 0x0C - FF - Form feed
Form feed means advance downward to the next "page". It was commonly used as page separators, but now it is also used as section separators. (It's uncommonly used in source code to divide logically independent functions or groups of functions.) Text editors can use this character when you "insert a page break".
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now