
whis is the IllegalArgument Exception in java? or define IllegalArgument Exception with exp?

IllegalArgument Exception is thrown when an illegal argument is sent to the method.
Example
import java.io.*;
public class GetStackTraceAsString{
public static String getStackTrace(Throwable throwable) {
Writer writer = new StringWriter();
PrintWriter printWriter = new PrintWriter(writer);
throwable.printStackTrace(printWriter);
return writer.toString();
}
public static void main (String[]args){
final Throwable throwable = new IllegalArgumentException("Hello");
System.out.println( getStackTrace(throwable) );
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.