1

This is my code:

String [][] array =   {  {"     /\     "}, 
                         {"    /  \    "},
                         {"   /    \   "}}

I would like to print it out, but when I compile it, then always comes the following error message:

illegal escape character

And the "/\" gets marked.
I know, that /\ is the symbol for escape, but how can I bypass this?

For help I would be very gratefull!

OPT_Developer
  • 43
  • 1
  • 1
  • 5

2 Answers2

4
System.out.print("/"); //will out --> /
System.out.print("\\"); //will out --> \
Ahmad Hammoud
  • 701
  • 1
  • 5
  • 15
3

You need to escape it, like this:

\\
Erik Pragt
  • 13,513
  • 11
  • 58
  • 64