Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

unicode escapes

807600Oct 20 2007 — edited Oct 23 2007
When I get the input of unicode escapes,
I can work with them as a String, but as soon as I add \u0022 (that is a double quote) to the input,
then it won't take it anymore, and it says ";" expected.
Now I am wondering, what is the way around this problem?

Any advice please?

public class Unicode
{

	String uniSt =  "\u0074\u0065\u0073\u0074"; // can't add \u0022 to this string
	// As soon as I add this double quote \u0022, it won't work and would say  ";" expected";
	public Unicode()
	{
		System.out.println(uniSt);
	
	}
	public static void main (String[] args)
	{
		new Unicode();

	}	
}

{code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 20 2007
Added on Oct 20 2007
10 comments
256 views