%! String getMsg() { double rand = Math.random(); String result="Random Number is "+rand+" if it is less than 0.1 "; if (rand < .1) { return result+"you win!"; } else { return result+"try again"; } } %>
Call a Java Method
<% // Use the method out.println(getMsg()); %>