This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
When I compile the code below, I get an error message stating, "illegal line end in character literal" What is reason for that? When and how can we use this literal then?
During the compilation process, the unicode character \u000A gets converted to the end of line character which causes the compiler error. You can use '\n' for newline instead.
Joined: Jun 10, 2004
First, thank you for the reply.
Why does it cause compiler error? "It gets converted to end of line." If it gets end of line, what is the problem with that? Why doesn't it do the same function as '\n'? If it is in the language, then where can we use the literal?