64 Part I: Getting Started 5. In the
64 Part I: Getting Started 5. In the dialog box s list, double-click the item labeled println(String Method in java.io.PrintStream. The documentation for the printlnmethod appears in the Editor pane. Using comments to experiment with your code You may hear programmers talk about commenting out certain parts of their code. When you re writing a program and something s not working correctly, it often helps to try removing some of the code. If nothing else, you find out what happens when that suspicious code is removed. Of course, you may not like what happens when the code is removed, so you don t want to delete the code completely. Instead, you turn your ordinary Java statements into comments. For instance, you turn the statement System.out.println( I love Java! ); into the comment // System.out.println( I love Java! ); This keeps the Java compiler from seeing the code while you try to figure out what s wrong with your program. Traditional comments aren t very useful for commenting out code. The big problem is that you can t put one traditional comment inside of another. For instance, suppose you want to comment out the following statements: System.out.println( Parents, ); System.out.println( pick your ); /* * Intentionally displays on four separate lines */ System.out.println( battles ); System.out.println( carefully! ); If you try to turn this code into one traditional comment, you get the following mess: /* System.out.println( Parents, ); System.out.println( pick your ); /* * Intentionally displays on four separate lines */ System.out.println( battles ); System.out.println( carefully! ); */
We will hook you up with a JSP web hosting at the great rate, check our jsp web hosting, and join us today!!!