This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Exceptions so only be used when your application encounters an exceptional circumstance that it can not over come. There is much debut upon the subject of what an exceptional circumstance is.
It would be worth your while to look up Exceptions on the Sun Java site, it has an excellent explanation.
Now, that being said, are you sure that for your application an exception is the correct way to report what is basicly a validation (range check) mismatch?
You have several spelling errors in the code, eg cube/Cube.
You cannot have any code in a method after its return statement.
Your CalculateException class ought to extend RuntimeException.
Don't call the same method from inside itself. Use double xxx = [something]; then use xxx rather than cube();
The cube method should be labelled static, and there is no need to create the new Calculate object.
Call cube(123.45) not cube().
Correct those errors and then see how it works. Also sort out your indentation; the code is difficult to read in its present state.
I thought it would cause too much confusion to say "extends IllegalArgumentException". Making it a checked Exception would require a throws, and the original poster is having enough difficulty as it is.