SyntaxFix
Write A Post
Hire A Developer
Questions
List<YourClass> list = ArrayList<YourClass>(); List<String> userNames = list.stream().map(m -> m.getUserName()).collect(Collectors.toList());
output: ["John","Alex"]