Consider the below

List<String> lstNames = new ArrayList<String>();
lstNames.add("Name1");
lstNames.add("Name2");
lstNames.add("Name3");
lstNames.add("Name4");
lstNames.add("Name5");

Which method in Java 1.8 will help to convert a Collection to Stream?

 Posted by Rajnilari2015 on 9/19/2015 | Category: Others Interview questions | Views: 2356 | Points: 40
Select from following answers:
  1. lstNames.stream()
  2. lstNames.getStream()
  3. lstNames.toStream()
  4. lstNames.collect(Collectors.toStream())
  5. All Above

Show Correct Answer


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response