The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
November 2000



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


Becuase of wrong escape sequence.see in detail

Posted by ketul(ruchi_ketu) on November 10, 2000 at 12:02 PM

Ruchi & Hema.

It�s very easy to understand why u get comment error.

All characters in java are Unicode characters composed of 2 bytes. ruchi comment also compile by compiler but run time it�s not considered. so when java compiler read backslash(\) then u get error because of improper use of backslash.

Let me tell u what is that. Backslash is a escape character. it indicates that �special� character is to be output. when a backslash is encountered in string of character. the next character is combined with the backslash. then it�s represents escape sequence. i think u know all sequence like \n,\r,\t,\�,\u0000 to \uFFFF all this.

In your case u had \u000a and \u000A . those are not valid escape sequence. if u have above any sequence then u don�t get hat problem even though u have backslash. i think that is y u get error like invalid escape sequence.

hema and ruchi if u understand without problem from my explanation then don�t forget to say thanks.

Best luck for your exam.


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us