Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Illegal Escape Character

Status
Not open for further replies.

Matrix03

Programmer
Apr 9, 2001
14
CH
After I compile this, I get the error - C:\JavaPrograms\Face.java:8: illegal escape character
System.out.println(" | \- |");
^

public class Face
{
public static void main(String[] args)
{
System.out.println("//////");
System.out.println("| o o |");
System.out.println("(| ^ |)");
System.out.println(" | \-/ |");
System.out.println(" _____ ");
}
}

How do I fix this.

Thanks,

Nick
 
just as a thought try

System.out.println("//////");
System.out.println("| o o |");
System.out.println("(| ^ |)");
System.out.println(&quot; | \\-/ |&quot;); <- Two \'s
System.out.println(&quot; _____ &quot;);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top