KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > snow > utils > ArrayUtils


1 package snow.utils;
2
3 public class ArrayUtils
4 {
5
6   public ArrayUtils()
7   {
8
9   } // Constructor
10

11   public static String JavaDoc toString(String JavaDoc[] a)
12   {
13     StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
14     for(int i=0; i<a.length; i++)
15     {
16       sb.append(""+a[i]);
17       if(i<a.length-1) sb.append(", ");
18     }
19     return sb.toString();
20   }
21
22   public static String JavaDoc toString(int[] a)
23   {
24     StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
25     for(int i=0; i<a.length; i++)
26     {
27       sb.append(""+a[i]);
28       if(i<a.length-1) sb.append(", ");
29     }
30     return sb.toString();
31   }
32
33 } // ArrayUtils
Popular Tags