title: Sorting a String using java collections
body: <p>I am attaching  following code and i want to sort this as </p>
  
  <pre><code> class sort{
      public static void main(String args[])  
      {String a ="this is a kiran";  
      StringTokenizer st =new StringTokenizer(a);  
      List f=new ArrayList();  
      f.add(st);  
      Collections.sort(f);  
      System.out.println("after sortting "+f);  
      }
   }
  </code></pre>
  
  <p>I want output as:</p>
  
  <pre><code>a
  is 
  kiran 
  this
  </code></pre>
  
  <p>But i am getting an exception as:-<br>
  Exception in thread "main" java.lang.ClassCastException: java.util.StringTokenizer cannot be cast to java.lang.Comparableat java.util.Collections.sort(UnknownSource)atcom.sort.main(Sort.java:18)</p>