title: To get list of member from list of objects using Streams java
body: <p>I have a class with two members and a list of objects of that class . Now I want to extract list of members from the list of objects.</p>
  
  <p>e.g : </p>
  
  <pre><code>class student {
        int Id;
        String studentName;
  }
  </code></pre>
  
  <p>now I need to retrieve a list of studentName, from list of students. How can this be done with java8 Streams?</p>
  
  <p>Solution without using streams:</p>
  
  <pre><code>List&lt;student&gt; studentList;
  List&lt;String&gt; nameList = new ArrayList&lt;String&gt;();
  Iterator iterator = studentList.iterator();
  while(iterator.hasNext()){
    nameList.add(iterator.next().getStudentName());
  }
  </code></pre>