Java, ‘hello world’, escape character?

For my first java project we where supposed to do an ascii drawing. I did this one but wound up needing an escape character to print "\". I just stuck a backslash in front of a backslash; did I break any java rules, or is that the proper way?. It did compile and I have everything lining up perfect

System.out.println(" @| |@ ");
System.out.println(" @| |@ ");
System.out.println(" @| |@ ");
System.out.println(" |_| ");
System.out.println(" |_| ");
System.out.println(" |_| ");
System.out.println(" |_| ");
System.out.println(" |_| ");
System.out.println(" |_| ");
System.out.println(" _|_|_ ");
System.out.println(" / \\ ");
System.out.println(" \\ _ / ");
System.out.println(" )( )( ");
System.out.println(" / _ \\ ");
System.out.println("( _ )");
System.out.println(" \\_____/ ");
it lines up *perfect in java, it just got gooffed up here in yahoo/html

While not the only way, it’s perfectly acceptable.

One Response to “Java, ‘hello world’, escape character?”

  1. TheMadProfessor on March 29th, 2010 at 11:27 pm

    While not the only way, it’s perfectly acceptable.
    References :

Leave a Reply