Solved

white space in java

Posted on 2014-01-10
3
539 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
3 Comments
 
LVL 1

Accepted Solution

by:
hcoragem earned 300 total points
Comment Utility
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
Comment Utility
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
Comment Utility
\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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This video teaches viewers about errors in exception handling.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now