About White space character in java
We already know about white space character in C and Cpp. Java has white space character list like \n – new line, \t – tab space, \r – carriage return, \b – blank space etc. These are basic character set in java. In this blog we will discuss different between print() and println() methods. Lastly, we will discuss how to write string in double “” in output screen.
[ Simple white space character program ]
public static void main(String args)
1. First line do not use println() method so, output of first and second line merge.
2. Third line uses println() method and two time \n, so output will be in two line break.
3. Fourth line has \t, so we can see space between ‘Ja’ and ‘va’.
4. Fifth line has \r, so we can see remove all character before \r.
5. Sixth line has \b, so we can see remove one character before \b.
6. Seventh line has \”, so we can see double “” on “Ja”.
Video available on YouTube
* * * * *
* * * * *
Send your tutorial task on email@example.com. We will check in 24 hours. And give more tips on it.
Share and Enjoy
220total visits,4visits today