Assignment 2

Name:
Due: Tuesday Sept 2nd
Homework - Lesson 1.5 - Console Printing

Question 1:
What is the output from the following Java program? (Assume that a tab is expanded into eight spaces.)
public class Letter {
   public static void main(String[] args) {
       System.out.println("Dear \"DoubleSlash\" magazine,");
       System.out.println();
       System.out.println("\tYour publication confuses me.  Is it");
       System.out.println("a \\\\ slash or a //// slash?");
       System.out.println("\nSincerely,");
       System.out.println("Susan \"Suzy\" Smith");
   }
}
Answer 1:





No comments:

Post a Comment