title: Iterate Nested list in java
body: <p>I want to display a tree view in my page. For that i will have a List object. List object will contain some more list objects. I don't know how many nested levels i will get. So please tell me, how to navigate through the list.</p>
  
  <p>Sample data i want to display is </p>
  
  <ul>
  <li><p>Education</p>
  
  <ul>
  <li>Mathematics
  <ul>
  <li>Trigonometry</li>
  </ul></li>
  <li>Science
  <ul>
  <li>Physics
  <ul>
  <li>nuclear physics</li>
  </ul></li>
  <li>chemistry</li>
  </ul></li>
  <li>Social</li>
  </ul></li>
  <li><p>Sports</p>
  
  <ul>
  <li>cricket</li>
  <li>foot ball</li>
  </ul></li>
  <li>Technology
  <ul>
  <li>mobiles</li>
  <li>computers
  <ul>
  <li>laptops</li>
  <li>pc</li>
  </ul></li>
  </ul></li>
  </ul>