Jeśli wiele wyjątków jest dozwolonych w catch(), to zmniejszy to ilość nadmiarowego kodu obsługi błędów. npWiele różnych typów obsługi wyjątków w jednym bloku catch?
try{
// some statments
}
catch(Type1Exception t1, Type2Exception t2, Type3Exception t3) { // wish if this could be allowed
/* t1, t2, t3 are children of Exception and needs same error handling then why to have different catch blocks with same piece of code */
}
http://download.oracle.com/javase/tutorial/essential/exceptions/index.html – mKorbel
@mKorbel: I ...? – mellamokb
@Close: Naprawdę nie rozumiem ludzi, którzy głosują, aby zamknąć pytanie, ponieważ nie widzą w nim znaku zapytania! Dalej, to interesujące pytanie! –