-1
System.out.println("Sun"); 
System.out.println( "     \   |    /   ");  
System.out.println(  "      -- 0  --     ");
System.out.println(  "      /   |  \     ");

I really dont't know what is wrong, I'm trying to print the following "symbol" to screen in java (using eclipse IDE) but it doesn't work and I get an error. I don't understand where this error comes from...

What happens and how can I solve it?

Thank you for your time and attention.

Ferran Buireu
  • 28,630
  • 6
  • 39
  • 67
The tiger7979
  • 11
  • 1
  • 2
  • 1
    you need [Escape Sequences](https://docs.oracle.com/javase/tutorial/java/data/characters.html) – Roger Dwan Nov 27 '15 at 09:37
  • Also, when you get an error and you decide to post it as a question, include the error. Most of the time the error will contain something useful we will be able to show you how to read it to avoid the errors in the future. – SlopeOak Nov 27 '15 at 10:14

1 Answers1

-1

You need to escape the backslashes.

         System.out.println( "     \\   |    /   ");  
         System.out.println(  "      -- 0  --     ");
         System.out.println(  "      /   |  \\     ");
Suresh Atta
  • 120,458
  • 37
  • 198
  • 307