Srikanth,
That code works perfectly without any errors if you are using any editor like eclipse.
If you are not using any editor, you have to take care about the class path settings.
Since your class path is not correct it is not able to find CheckingAccount class. Hence the error.