hi,
Thanks Talukdar ,
I have writen a sample code to
test your suggestion hope it will be useful to understand
Type this in the command prompt while executing code.
java ErrStreamCheck >> test.txt
Error free output will go into file 'test.txt' and error records get printed into consol.
public class ErrStreamCheck
{
public static void main(
String args[])
{
String strArr[] = { "p1","p2","p3" };
for(int i =0 ; i<5 ; i++ )
{
try
{
System.out.println("array content " + strArr[i] );
}
catch( Exception oEx )
{
System.err.println("Exception due to wrong index.");
}
}
}
}
[ January 22, 2003: Message edited by: Arun Boraiah ]
[ January 22, 2003: Message edited by: Arun Boraiah ]