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.