Page 2 of 2 FirstFirst 12
Results 21 to 26 of 26
  1. #21
    tnrh1 is offline Senior Member
    Join Date
    Aug 2011
    Posts
    251
    Rep Power
    4

    Default Re: Finding maximum..

    Yes I can see that, but in the end you get 4 max variables, one for each line.
    He asks for 1 max variable, for all the lines.

  2. #22
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,798
    Rep Power
    7

    Default Re: Finding maximum..

    Yes and each time I call the findMax method it compares each value in the array with the max instance variable. After all four arrays have been passed to the findMax method the max variable will hold the highest number.

  3. #23
    tnrh1 is offline Senior Member
    Join Date
    Aug 2011
    Posts
    251
    Rep Power
    4

    Default Re: Finding maximum..

    Then it should look like this FindMax(ar1,max);
    Anyway nice one, it's a good solution.
    But saying that my first solution is load of tosh is offensive, definitely when it's true.
    I agree that some of the variables was unnecessary but it's certainly not load of tosh.

    Anyway I think that the thread maker has now few options to solve his problem.
    Case solved :)

  4. #24
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,798
    Rep Power
    7

    Default Re: Finding maximum..

    I'm sorry your delicate sensibilities were offended. Why I said it was a load of tosh is because your post made it sound like your solution was the only way to do it. You have to be careful how you phrase things especially when talking to n00bs.

  5. #25
    putrify is offline Member
    Join Date
    Sep 2011
    Posts
    10
    Rep Power
    0

    Default Re: Finding maximum..

    Didn't mean to get you two worked up haha, but I really do appreciate both of your ideas and solutions. Thank you :)

    P.S. I'm a she, for future reference :p

  6. #26
    tnrh1 is offline Senior Member
    Join Date
    Aug 2011
    Posts
    251
    Rep Power
    4

    Default Re: Finding maximum..

    Quote Originally Posted by Junky View Post
    I'm sorry your delicate sensibilities were offended. Why I said it was a load of tosh is because your post made it sound like your solution was the only way to do it. You have to be careful how you phrase things especially when talking to n00bs.
    I'll adopt this ^^

    Quote Originally Posted by putrify View Post
    P.S. I'm a she, for future reference :p
    I'll remember that

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 8
    Last Post: 03-25-2011, 11:38 PM
  2. Finding maximum number at index position
    By Shyamz1 in forum New To Java
    Replies: 9
    Last Post: 10-27-2010, 08:14 PM
  3. Maximum subsequence
    By dxg in forum New To Java
    Replies: 12
    Last Post: 09-25-2010, 05:40 PM
  4. find maximum value from for loop
    By napi1234 in forum New To Java
    Replies: 15
    Last Post: 06-02-2010, 03:39 PM
  5. Maximum size of an array
    By Hasan in forum New To Java
    Replies: 1
    Last Post: 05-20-2007, 11:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •