I've seen this question many times in the forums but no one can defintely answer why the answer is 'null null'.
Here is the code:
The command line invocation is:
java Miner diamond.
The choices are:
A.-null
B.-null null
C.-A ClassCastException is thrown
D.-A NullPointerException is thrown
E.- A NoClassDefFoundErrorr is thrown
F.-An ArithmeticException is thrown
G.-An IllegalArgumentException is thrown
H.-An ArrayIndexOutofBoundsException is thrown
The result is:
B-"null null".
Here are my questions:
1. Why is the answer 'null null'?
2. Shouldn't the answer be F.-An ArithmeticException is thrown becuase in the method getWeight(), you're dividing x by zero?
3. Why is there a 'diamond' in the command line line invocation 'java Miner diamond'? Is it there just to confuse you?
Thanks in advance
-Fritz