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.