• Amused
  • Angry
  • Bored
  • Busy
  • Cheeky
  • Cold
  • Confused
  • Cool
  • Devilish
  • Fine
  • Hacker
  • Happy
  • In Love
  • Innocent
  • Lonely
  • Nerdy
  • Pensive
  • Roflol
  • Sad
  • Starving
  • Stressed
  • Yeehaw
  • Page 79 of 79 FirstFirst ... 2969777879
    Results 781 to 782 of 782

    Thread: The Official Programming Thread

    1. #781
      Moderator
        XxRebellionxX's Avatar

      I am:
      Nerdy
       
      Steam ID: rebellion121
      MainMy Activity InfoMy PG Info
      Posts
      6,132
      Daily Activity
      0%
      Lv. Percent
      24.47%
      Quote Originally Posted by Newton View Post
      Which name is being used for the sort? I'm assuming it's using the surname. You really should have your own comparator for this situation. In your comparator decide the order based on the last name, in case if both the last names are the same then decide on the first name; if the first names are the same too then retain their order in the sorted list. Such a comparator will give you a correct output.
      So its absolutely necessary to use the comparator, it can't be done without it?
      Is it possible to convert the Set to ArrayList and then use Collections.sort?


    2. #782
      PG Juggernaut

      I am:
      Busy
       
      MainMy Activity InfoMy PG Info
      Posts
      2,224
      Daily Activity
      0%
      Lv. Percent
      41.93%
      Quote Originally Posted by XxRebellionxX View Post
      So its absolutely necessary to use the comparator, it can't be done without it?
      Is it possible to convert the Set to ArrayList and then use Collections.sort?
      even in that case, it will sort based on the default comparison. It won't handle custom cases where the value being sorted upon is the same for 2 or more elements.

     

     

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •  
    All times are GMT +5. The time now is 09:49 PM.


    Back to Top Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
    Shoutbox provided by vBShout (Pro) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
    Copyright 2018 PakGamers. All rights reserved.