MCPcopy Index your code
hub / github.com/castello/spring_basic / getRandomInt

Method getRandomInt

ch2/TwoDiceServlet.java:14–16  ·  view source on GitHub ↗
(int range)

Source from the content-addressed store, hash-verified

12@WebServlet("/rollDice2")
13public class TwoDiceServlet extends HttpServlet {
14 int getRandomInt(int range) {
15 return new Random().nextInt(range)+1;
16 }
17
18 public void service(HttpServletRequest request, HttpServletResponse response) throws IOException {
19 int idx1 = getRandomInt(6);

Callers 1

serviceMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected