Difference between "\n" and '\n'

Hi all,I know this sounds abit stupid, but I wish to clarify this issue. What is the difference between "\n" (double quotes) and '\n' (single quote)?From what I know, this 2 syntax does a lineFeed, but there must be a difference right?Please advise. Thanks.
[287 byte] By [sai1sga] at [2007-11-27 4:56:41]
# 1
"\n" is a string consisting of one character. And that character is '\n'.Strictly speaking neither of them "does" a linefeed. But if you print either of them with System.out.print() you will get a new line (combination of linefeed and carridge return).
pbrockway2a at 2007-7-12 10:11:55 > top of Java-index,Java Essentials,New To Java...
# 2

Yes, as you have guessed, both are newline characters.

The difference is that the double quotes represents a string and the

single quotes replresents a character.

You usually add the double quotes when using it with a line of string to display it on a new line.

While the character is used when you do a comparison character by character.

for example

if(str.charAt(10)=='\n')

ArcherKinga at 2007-7-12 10:11:55 > top of Java-index,Java Essentials,New To Java...