Solved

white space in java

Posted on 2014-01-10
3
556 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
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to increase Spring boot/Tomcat max file upload size 2 143
Eclipse with gitlab 1 79
ejb on wildfly 5 30
swing controls 2 16
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

860 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