CrazyEngineers
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • rahul69

    MemberSep 13, 2013

    Alok mishra
    Someone 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 ?
    Ask 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.
    Are you sure? This action cannot be undone.
    Cancel
  • Alok mishra

    MemberSep 13, 2013

    rahul69
    Ask 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.
    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?
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register