Lesson 33 of 34
Sorting, Comparator மற்றும் Lambdas
10 min 35 XP
Collections.sort() எண்களையும் String-களையும் வரிசைப்படுத்தும். Objects-ஐ வரிசைப்படுத்த Comparator தேவை. Lambda (a, b) -> ... என்பது சிறிய method-ஐ ஒரே வரியில் எழுதும் வழி.
Example: edit me and press Run
Output Loading Java (first time takes a few seconds)
Press Run to see the result here.Streams மூலம் filter, map போன்றவற்றை சுருக்கமாக எழுதலாம். Modern Java interviews-ல் இவை அடிக்கடி வரும்.
Example: edit me and press Run
Output Loading Java (first time takes a few seconds)
Press Run to see the result here.