Ankit Minglani wrote:Hi All,
Happy to let you know that I have passed OCAJP8 - Programmer I - 1Z0-808 with 95% score. I have shared my preparation and experience for certification on my personal blog:
Would like to thank people in this community for keeping the culture of helping each other. It is really great for newcomers trying to take these certification exams or otherwise.
shambhavi ss wrote:alright thanks all , got it !
i have another question !
in the above code, in line 3, if i do not declare the exception or if i do not handle it inside main(), i have a compiler error.
when the eatCarrot() method has declared the exception then why should the main() again do it ?? if eatCarrot() method definition throws an exception, it'll be thrown as declared by its respective 'throws' clause in its signature, right ? why should we again declare the exception in main() i.e. in the caller of eatCarrot() ?