Amir,
When you throw an exception using throw inside any method ,
you should also declare it in methods header using throws clause.
So the following code doesn't compile.
void aMethod() {
throw new Exception("new exception");
}
Correct syntax would be
void aMethod() throws Exception {
throw new Exception("new exception");
}
Ususally you use throw statement with conditional statement.
For example
You are advertising every possible exception that your method might actually throw by declaring them in methods header using throws clause.
Hope that helps.
Veena