# 工具类 如果想实现1~10之间的随机数,下面哪个代码可以实现: ## 答案 A ## 选项 ### A ```Java Random random = new Random(); int result = random.nextInt(10); result = result + 1; ``` ### B ```Java Random random = new Random(); int result = random.nextInt(1); result = result + 10; ``` ### C ```Java int max = 10; int min = 1; Random random = new Random(); int result = random.nextInt(min) % (max - min + 1) + min; System.out.println(result); ``` ### D 以上都是