public class Java0207 { public static void main (String[] args) { System.out.println("One"); System.out.println("Two"); System.out.println("Four"); System.out.println("Five"); System.out.println("Six"); // half a dozen System.out.println("Seven"); System.out.println("Eight"); System.out.println("Nine"); System.out.println("Ten"); System.out.println("Eleven"); System.out.println("Twelve"); // one // System.out.println("Thirteen"); // one baker's dozen } } One Two Three Four Five Six Seven Eight Nine Ten Eleven Twelve The second comment-type is the This type of comment is Comment. shown in program Java0208.java in figure 2.13. A followed by an slash asterisk /* is used to mark the beginning of the multi-line comment. An followed asterisk by a */ is used to mark the end. Be careful not to forget to your slash end comment. If you do, the remainder of your program becomes one big comment. Multi-line comments are useful when entire sections need to be commented-out. Figure 2.13 // Java0208.java /* This program is very similar to the previous program, but the output will be different. Instead of displaying all number words from "One" through "Thirteen",
public class Java0207 { public static void main (String[] args) { System.out.println("One"); System.out.println("Two"); System.out.println("Four"); System.out.println("Five"); System.out.println("Six"); // half a dozen System.out.println("Seven"); System.out.println("Eight"); System.out.println("Nine"); System.out.println("Ten"); System.out.println("Eleven"); System.out.println("Twelve"); // one // System.out.println("Thirteen"); // one baker's dozen } } One Two Three Four Five Six Seven Eight Nine Ten Eleven Twelve The second comment-type is the Comment. This type of comment is shown in program Java0208.java in figure 2.13. A slash followed by an asterisk /* is used to mark the beginning of the multi-line comment. An asterisk followed by a slash */ is used to mark the end. Be careful not to forget to end your comment. If you do, the remainder of your program becomes one big comment. Multi-line comments are useful when entire sections need to be commented-out. Figure 2.13 // Java0208.java /* This program is very similar to the previous program, but the output will be different. Instead of displaying all number words from "One" through "Thirteen",
Text02-IntroToJava-1.docx