Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- /**
- A Engine class.
- */
- public class Engine
- {
- /**
- Checks if the engine is ok, if it's not it throws a EngineException.
- @throws EngineException when a randomly generated double is below 0.001
- */
- public void engineCheck() throws EngineException {
- Random random = new Random();
- if(random.nextDouble() < 0.001){
- throw new EngineException();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement