APCS Java Subset

Class IllegalArgumentException

  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.lang.RuntimeException
              extended byap.java.lang.IllegalArgumentException
All Implemented Interfaces:

public class IllegalArgumentException
extends java.lang.RuntimeException

Students should understand this error/exception when it occurs in a program.

According to the Java API, an object if this class is thrown when a Java method receives an argument that is "illegal or inappropriate".

For example, in the AP subset, an IllegalArgumentException might be thrown if a negative argument is passed to a square-root function.

AB students are expected to be able to throw this exception in code they write.

See Also:
Serialized Form

Constructor Summary
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail


public IllegalArgumentException()

unofficial documentation for the APCS Java Subset