Lesson 33 of 34
Sorting, Comparators మరియు Lambdas
10 min 35 XP
Collections.sort() సంఖ్యలు, Strings ను sort చేస్తుంది. Objects ను sort చేయడానికి Comparator కావాలి. (a, b) -> ... వంటి lambda ఒక చిన్న method ను ఒకే లైన్లో రాస్తుంది.
Example: edit me and press Run
Output Loading Java (first time takes a few seconds)
Press Run to see the result here.Streams తో collections ను కొన్ని పదాల్లోనే filter, transform చేయవచ్చు. ఆధునిక Java interviews లో వీటి గురించి తరచుగా అడుగుతారు.
Example: edit me and press Run
Output Loading Java (first time takes a few seconds)
Press Run to see the result here.