Search:

Type: Posts; User: javapenguin

Search: Search took 0.09 seconds.

  1. Replies
    4
    Views
    1,822

    Re: Number Array

    Change newbie's code to set it to set highest value to the first index of the array. Then compare it like before. This way, it can handle negatives.
  2. Replies
    4
    Views
    1,822

    Re: Number Array

    Kinda of.

    int[] test = {1, 2, 3, 4};
    int highestVal = 0;


    int position = -1;
    for (int i = 0; i < test.length; i++) {
    if (test[i] > highestVal) {
    ...
Results 1 to 2 of 2