Package java.lang

Examples of java.lang.Double.intValue()


      if ("1+2".equals(question)) {
        answer = "3";
      } else {
            Random r = new Random(new Date().getTime());
            Double d = new Double((r.nextDouble() * 20) - 1);
            answer = new String(answers[d.intValue()]);
      }
    System.out.println("EightBall answer: " + answer);
    return answer;
    }

View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.