[2 / 1 / ?]
Quoted By:
Which is true about the following method?
public void doSomething(int n) {
if(n<0)
throw new Exception("Negative Number");
}
Select one or more:
it will compile and run without crashing
it will not compile, but it could be fixed by adding a try/catch block
it will not compile, but it could be fixed by adding a throws clause to the method header
public void doSomething(int n) {
if(n<0)
throw new Exception("Negative Number");
}
Select one or more:
it will compile and run without crashing
it will not compile, but it could be fixed by adding a try/catch block
it will not compile, but it could be fixed by adding a throws clause to the method header