    class Conv
   {
       static public void main(String args[])
      {
        // String to integer
         System.out.println(Integer.valueOf("123").intValue());
      
        // Or less confusingly:
         String s="123";
         Integer i=Integer.valueOf(s);
         int j=i.intValue();
         System.out.println(j);
      
        // Or better: (parseInt returns int, while valueOf returns Integer)
         j=Integer.parseInt("123");
         System.out.println(j);
      
        // Convert int to String
         i=new Integer(j);
         s=i.toString();
         System.out.println(s);
        
        // which is the same as
         System.out.println(new Integer(j).toString());
      }
   }