Read the API for the Integer class. Search keywords java autoboxing.
I liked the way this program was looking when it was dealing with int[] rather than Vector<Integer>, but either way can work....
Type: Posts; User: jps
Read the API for the Integer class. Search keywords java autoboxing.
I liked the way this program was looking when it was dealing with int[] rather than Vector<Integer>, but either way can work....
If I remember correctly you were using this the first time around. I have not been following this thread very closely, but aren't you trying to generate two integers (die roll) and compare the...
The .equals method checks to see if two objects are the same exact object (pointer to the same place in memory). This is not the same thing done by the == operator
System.out.println("index is: " + sumArray[i]);
i would be the index, sumArray[i] would be the value at index i within the array.
Or do I not understand you correctly?
for (int j = 0; j < a-1; j++){
if (sum == sumArray[j]){
System.out.println("You win!");
break;
}
}
What is this doing?
Does the code compile and run? What seems to be...