?
Solved

white space in java

Posted on 2014-01-10
3
Medium Priority
?
576 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 1200 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 800 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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses
Course of the Month12 days, 3 hours left to enroll

752 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