java - How to manage catches with the same behavior -



java - How to manage catches with the same behavior -

i have piece of code can throw 3 different types of exceptions. 2 of these exceptions handled in way while 3rd handled in way. there idiom not cutting , pasting in manner?

what is:

try { anobject.dangerousmethod(); } grab {aexception or bexception e) { /*do something*/ } grab {cexception e) { /*do else*/ }

there in jdk 7, not in before java versions. in jdk 7 code this:

try { anobject.dangerousmethod(); } grab {aexception | bexception e) { /*do something*/ } grab {cexception e) { /*do else*/ }

java exception

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -