Friday, 22 March 2013

Reserved Words

 Reserved Words in JAVA:-

  Some identifiers are reserved to associate some functionality or to represent values , such type of reserved identifiers are called "Reserved Keywords".


Keywords for Data types:

byte                         folat

short                       double

int                           char

long                         boolean

Keywords for FlowControl:

if                 do        break


else            while         continue



switch         for   return


case


default





Keywords for Modifers:

public      native

private   synchronized


protected     volatile


final              transient


abstract           strictfp

Keywords for ExceptionHandling:


try

catch

finally

throw

throws


assert---------1.4  Version(debugging)



 Class Related Keywords:

class

interface

package

extends

implements

import


Object Related Keywords:

new

instanceof

super

this



Valid return type Keywords:

if a method doesn't return anything compulsory that method should be with void return type


Unused Keywords:


goto  ----- in java usage is considered as harmful

const------- alternativly we should use final keyword


Enum Keyword:

This Keyword has introduced in 1.5 version , to define user defined data types


EX:

           enum Month                                                          enum   Beer

          {                                                                              {

                        JAN,FEB,MAR....DEC;                            KO,KF,RC,FO,BR;
           }                                                                              }

Resrved Literals:


true, fasle----- Allowed values for boolean data types 

null------Default value for object reference





No comments:

Post a Comment