why the above code gives compile error???
can anyone explain please??
Joined: Sep 06, 2009
because at compile time the compiler knows only about the Hotel class.....compiler thinks you would call Hotel's method whch declares to throw a checked exception....which shoudl be caught....which isnt in your code....so bang ...compile error