当前位置: 技术问答>java相关
一个Java程序问题!!
来源: 互联网 发布时间:2015-02-28
本文导语: public class IceCream { static String[] flav={ "Chocolate","Strawberry","Vanilla Fudge Swirl", "Mint Chip","Mocha Almond Fudge","Run Raisin", "Praline Cream","Mud Pie"...
public class IceCream {
static String[] flav={ "Chocolate","Strawberry","Vanilla Fudge Swirl",
"Mint Chip","Mocha Almond Fudge","Run Raisin",
"Praline Cream","Mud Pie"
};
static String[] flavorSet(int n) {
// Force it to be positive &within bounds:
n=Math.abs(n)%(flav.length+1); (1)
String[] results=new String[n];
int[] picks=new int[n];
for(int i=0;i
static String[] flav={ "Chocolate","Strawberry","Vanilla Fudge Swirl",
"Mint Chip","Mocha Almond Fudge","Run Raisin",
"Praline Cream","Mud Pie"
};
static String[] flavorSet(int n) {
// Force it to be positive &within bounds:
n=Math.abs(n)%(flav.length+1); (1)
String[] results=new String[n];
int[] picks=new int[n];
for(int i=0;i