Tuesday, December 29, 2015

Three Messages Ex. 1.1

//Display three messages
public class ThreeMessages {
       public static void main(String[] args) {
             System.out.println("Welcome to Java");
             System.out.println("Welcome to Computer Science");
             System.out.println("Programming is fun");
       }
}//end class




TABLE 1.2 Special Characters
Character/Name                               Description
{} Opening and closing braces                Denote a block to enclose statements.
() Opening and closing parentheses           Used with methods.
[] Opening and closing brackets              Denote an array.
// Double slashes                            Precede a comment line.
" " Opening and closing quotation marks      Enclose a string (i.e., sequence of                                                        characters).
; Semicolon                                  Mark the end of a statement.

No comments:

Post a Comment