The Official Programming Thread

XxRebellionxX

Moderator
Moderator
Mar 10, 2010
6,130
0
42
Dublin
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?
 

Newton

Well-known member
May 17, 2009
2,223
0
41
Lahore, Faisalabad
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.
 
General chit-chat
Help Users
We have disabled traderscore and are working on a fix. There was a bug with the plugin | Click for Discord
  • No one is chatting at the moment.
  • S Shadowdragoo:
    no idea how that is a steal by wasting 3500 rupees per month and for games that are removed before you can finish them off.xbox gamepass is garbage with no local prices
    Link
  • faraany3k faraany3k:
    Just finished Diablo 4 season in hurry to play Fallout 4 but gamepass released another banger in the form of Star Wars on April 25th. Gamepass is a steal man.
    Link
  • Necrokiller Necrokiller:
    EternalBlizzard said:
    Is it just me or people lately seem to defend every bad game design decision made by the devs and try to give bullshit reasons for that? Or perhaps it's because I'm on reddit and discord :ROFLMAO:
    There are no such thing as "bad design" bro, its all "artistic vision" now :ROFLMAO:
    • Haha
    Reactions: EternalBlizzard
    Link
  • EternalBlizzard EternalBlizzard:
    Is it just me or people lately seem to defend every bad game design decision made by the devs and try to give bullshit reasons for that? Or perhaps it's because I'm on reddit and discord :ROFLMAO:
    • Haha
    Reactions: Necrokiller
    Link
  • B Baghi:
    vos
    Link
  • Link
  • G gorillageneral:
    It's me cattoboee
    Link
  • G gorillageneral:
    It's me tattooed
    Link
  • Link
  • C cattoboee:
    testing
    Link
  • NaNoW NaNoW:
    true
    Link
  • faraany3k faraany3k:
    Add 20 years into your age. Congrats you are in Playstation 8 era. Probably a VR streaming headset in a form of glasses.
    Link
  • S Shehryar89:
    Hi any repair shop for Nintendo Switch in Isb/ Rwp? The console is not charging. Anybody? Who can help in this regard.
    Link
  • iampasha iampasha:
    Ewww brother ewww, what's that brother? Whats that?
    Link
  • Necrokiller Necrokiller:
    Senua Saga 30fps both on Series S and X. Gotta feel bad for the Series X owners.
    Link
  • Necrokiller Necrokiller:
    Imagine buying a Pro console and still getting 30fps in GTA 6 😬
    Link
  • faraany3k faraany3k:
    So this console gen was like putting a SSD in an old laptop
    Link
  • LordIT LordIT:
    does anyone know a reliable vendor in lahore for laptop batteries?
    Link
  • XPremiuM XPremiuM:
    I remember when PG used to be such an active site. Now it's barely alive.
    Link
  • XPremiuM XPremiuM:
    Any mods online?
    Link
  • NaNoW NaNoW:
    .....
    Link
  • Link
  • techyrock techyrock:
    Duibuqi bukeyi
    Link
  • Link
  • techyrock techyrock:
    zenme le
    Link
    S Shadowdragoo: no idea how that is a steal by wasting 3500 rupees per month and for games that are removed...