What is the meaning of \\r carriage return and /f form feed in Java? Can anyone give a small example of when we have to use these types of symbols?
Carriage return and form feed are terminal or printer control characters and have no meaning whatsoever in Java.
In a terminal emulation, when you print a \r, the next character will possibly get printed at the first row of the current line (overwriting what is there already).
A form feed, when printed to a terminal may or may not clear the screen. On a printer, it should cause the current page to get ejected, so that printing continues on a new page.
But, as said before, neither the terminal (emulation) nor the printer do care whther the control character was printed by a Java program.