Solved

white space in java

Posted on 2014-01-10
3
570 Views
Last Modified: 2014-01-21
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
Comment
Question by:gudii9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Accepted Solution

by:
hcoragem earned 300 total points
ID: 39772627
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
 
LVL 7

Author Comment

by:gudii9
ID: 39786455
What is difference between Line Feed and Form Feed. Please advise
0
 
LVL 1

Assisted Solution

by:Smart_Kid
Smart_Kid earned 200 total points
ID: 39787742
\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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
In this post we will learn different types of Android Layout and some basics of an Android App.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question