Hello i am a noob java programmer.I have written two codes the first one works fin e and there is no error however in the second code there are lots of error.Can someone explain why the white spaces are not acknowleged in the second code.Also is there any other way of writing this code without using System.out.println multiple times? code1[with errors]
public class letter
{
public static void main(String[] args)
{
System.out.println("+----------------------------------------------------+
| ### |
| ## |
| # |
| |
| |
| |
| |
| Bill gates |
| Microsoft 1 way |
| Redmond,WA 98603 |
| |
+----------------------------------------------------+");
}
}
code2[errorless]
public class Lettertoyourself
{
public static void main(String[] args)
{
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("| Bill gates |");
System.out.println("| Microsoft 1 way |");
System.out.println("| Redmond,WA 98603 |");
System.out.println("| |");
System.out.println("+----------------------------------------------------+");
}
}