Is there any way to throw multiple exceptions in java?
A method can throw one of several exceptions. Eg:
public void dosomething() throws IOException, AWTException {
// ....
}
This signals that the method can eventually throw one of those two exceptions (and also any of the unchecked exceptions). You cannnot (in Java or in any language AFAIK) throw simultaneously two exceptions, that would not make much sense.
You can also throw a nested Exception, which contains inside another one exception object. But that would hardly count that as "throwing two exceptions", it just represents a single exception case described by two exceptions objects (frequently from different layers).