Replies
Welcome, guest
Join CrazyEngineers to reply, ask questions, and participate in conversations.
CrazyEngineers powered by Jatra Community Platform
-
@rahul69-97fAOs • Sep 13, 2013
Ask that someone to be specific ,as "anything we want" may include a lot of things.Alok mishraSomeone was arguing me that we can not write 'anything we want' in catch block !! Is it so ? Are there any limitations on the code that we put within catch ?
As u cannot write "Anything u want" inside the main() function, it must be a valid code.
Regarding catch blocks, if u are trying to catch multiple exceptions in a single catch block (Assuming Java 7), u cannot change the catch parameter inside the catch block. -
@alok-mishra-E4tgN8 • Sep 13, 2013
if we write another valid program inside catch that sorts a given array and prints and from try we manually throw an exception then i think catch will successfully sort that array and print .no?rahul69Ask that someone to be specific ,as "anything we want" may include a lot of things.
As u cannot write "Anything u want" inside the main() function, it must be a valid code.
Regarding catch blocks, if u are trying to catch multiple exceptions in a single catch block (Assuming Java 7), u cannot change the catch parameter inside the catch block.