Java Reference
In-Depth Information
15. Rewrite the following code as a series of equivalent System.out.println statements (i.e., without any
System.out.print statements):
System.out.print("Twas ");
System.out.print("brillig and the");
System.out.println(" ");
System.out.print(" slithy toves did");
System.out.print(" ");
System.out.println("gyre and");
System.out.println("gimble");
System.out.println();
System.out.println( "in the wabe.");
Section 1.3: Program Errors
16. Name the three errors in the following program:
1 public MyProgram {
2 public static void main(String[] args) {
3 System.out.println("This is a test of the")
4 System.out.Println("emergency broadcast system.");
5 }
6 }
17. Name the four errors in the following program:
1 public class SecretMessage {
2 public static main(string[] args) {
3 System.out.println("Speak friend");
4 System.out.println("and enter);
5
6 }
18. Name the four errors in the following program:
1 public class FamousSpeech
2 public static void main(String[]) {
3 System.out.println("Four score and seven years ago,");
4 System.out.println("our fathers brought forth on");
5 System.out.println("this continent a new nation");
6 System.out.println("conceived in liberty,");
7 System.out.println("and dedicated to the proposition");
8 System.out.println("that"); /* this part should
9 System.out.println("all"); really say,
10 System.out.println("men"); "all PEOPLE!" */
11 System.out.println("are";
12 System.out.println("created");
13 System.out.println("equal");
14 }
15 }
Search WWH ::




Custom Search