java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.lang.ClassCastException
- All Implemented Interfaces:
- Serializable
- See Also:
- Top Examples, Source Code
public ClassCastException()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[304]Convert arraylist to String
By Anonymous on 2005/05/31 03:17:32 Rate
// convert arraylist to String
public static String convertStringFromArrList ( List lst,
String delim )
{
if ( lst == null ) {
return null;
}
Object [ ] oArray = lst.toArray ( ) ;
StringBuffer strBuf = new StringBuffer ( ) ;
try {
if ( oArray.length > 0 ) strBuf.append ( oArray [ 0 ] .toString ( ) ) ;
} catch ( ClassCastException cce ) {
//error handling here
}
for ( int i = 1; i < oArray.length; i++ ) {
strBuf.append ( delim + ( String ) oArray [ i ] ) ;
}
return strBuf.toString ( ) ;
}
public ClassCastException(String s)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples