Java syntax: Difference between revisions

Content deleted Content added
Line 724:
 
====<code>throw</code> statement====
The <code>throw</code> statement is used to throw an exception and end the execution of the block (or method). execution.The Thrownthrown exception instance is written after the <code>throw</code> statement.
 
<source lang=Java5>
Line 732:
throw new NullPointerException();
}
// Will not be called, if object wasis null
doSomethingWithObject(obj);
}