| Author |
Trouble compiling my program
|
Stacey Lee
Greenhorn
Joined: May 08, 2003
Posts: 3
|
|
Hello All, I am VERY new to Java and I am having some trouble I am hoping you all can help me out. Below is the code for the program i am trying to run. When I compile the code I get the following error "Face.jave:8: illegal escape character System.out.println("|\_/|"); Can someone help me and tell me what this means and how to fix it? Thanks Stacey 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(" ------"); } }
|
 |
leo donahue
Ranch Hand
Joined: Apr 17, 2003
Posts: 327
|
|
The '\' is an escape character meaning that it is looking for something like: \n, or \t. Try this, use two escape characters \\_: 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(" ------"); } }
|
Thanks, leo
|
 |
Stacey Lee
Greenhorn
Joined: May 08, 2003
Posts: 3
|
|
That worked perfect!!! Thanks for your help Leo
|
 |
 |
|
|
subject: Trouble compiling my program
|
|
|