title: sorting objects into an array of elements and an array with several elements
body: <p>I have to sort a list of students, depending on the specialty they applied to.</p>
  <p>My variabile for array in object is <code>String [] specializations;</code></p>
  <p>The objects I introduced look like this:</p>
  <p><code>x.add (new Students (&quot;Tudorache1&quot;, &quot;Marinel&quot;, new String [] {&quot;Programmer&quot;, &quot;WEB&quot;}, 12, 24, 2020));</code></p>
  <p><code>x.add (new Students (&quot;Tudorache7&quot;, &quot;Marinel2&quot;, new String [] {&quot;Operator&quot;, &quot;WEB&quot;, &quot;Developer&quot;}, 12, 24, 2021));</code></p>
  <p><code>x.add (new Students (&quot;Tudorache3&quot;, &quot;Marinel3&quot;, new String [] {&quot;Constructor&quot;, &quot;Accountant&quot;, &quot;Secretary&quot;}, 12, 24, 2018));</code></p>
  <p>How can I sort by iteration to get:</p>
  <p>WEB
  Tudorache1
  Tudorache7</p>
  <p>Programmer
  Tudorache1</p>
  <p>Operator
  Tudorache7</p>
  <p>Developer
  Tudorache7</p>
  <p>Constructor
  Tudorache3</p>
  <p>Accountant
  Tudorache3</p>
  <p>Secretary
  Tudorache3</p>