Page 15 - DCAP501_Modern Programming Tools and Techniques I
P. 15

Modern Programming Tools and Techniques I



                          4.   break: This Java keyword is used to restart the execution of a program at the statement that is just
                              after the current enclosing block or statement. In case this keyword has a label just after it, the
                              program restarts execution at the statement just after the enclosing labeled statement or block.
                          5.   byte: This Java keyword is an 8-bit integer. It is used for declaring the value that a method will
                              return, an expression, or variable of type byte.

                          6.   case: This Java keyword is used for defining a set of statements. This keyword is generally used
                              with the switch statement.
                          7.   catch: This Java keyword is used for handling the exceptions occurring in a program above try
                              keyword.
                          8.   char: This Java keyword is used for declaring an expression, value that a method will return, or
                              variable of type character.
                          9.   class: This Java keyword is used for defining the implementation of an object of a particular kind.
                          10.  continue:  This Java keyword is used for continuing the program at the end of the body of the
                              current loop.
                          11.  default: This Java keyword is used for defining a set of statements to begin the execution. This is to
                              be used in case no suitable match is found for the value that is defined by the enclosing switch
                              statement, among the values indicated by a case keyword in the switch statement.

                          12.  do: This Java keyword is used for declaring a loop that will repeat a block of statements. The exit
                              condition of this loop is indicated with the while keyword. The loop’s execution will happen once,
                              before the evaluation of the exit condition.
                          13.  double: This Java keyword is a 64-bit floating point value. This keyword is used for declaring an
                              expression, the value a method will return, or variable that is of type double-precision floating
                              point.

                          14.  else: This Java keyword is used for testing the condition. If the test condition indicated by the if
                              keyword evaluates to false, a statement or block of statements are executed. The else keyword is
                              used for defining such statement or block of statements.

                          15.  enum: This Java keyword is used for declaring an enumerated type.
                          16.  extends: This Java keyword is used for specifying the super class in a class declaration, and also for
                              specifying one or more super interfaces in the declaration of an interface.
                          17.  final: This Java keyword is used for defining an entity once, which cannot be changed or derived
                              later. Also, no class can be inherited from a final class, and all methods defined in a final class are
                              completely final.
                          To know the functions of other keywords, refer http://en.wikipedia.org/wiki/List_of_Java_keywords
                          or http://www.cafeaulait.org/course/week2/09.html



                                      Java supports some reserved words such as true, false, and null. As these are reserved

                                      words, not keywords, they cannot be used as names for programs.
                          1.4   Constants

                          Unlike keywords that are predefined and kept aside by Java for special purpose, constants are values
                          that do not change during the program execution. The keyword final is used to declare the constants.






                          8                       LOVELY PROFESSIONAL UNIVERSITY
   10   11   12   13   14   15   16   17   18   19   20