[Question]
  [
Okey, we all know the normal way to throw a IllegalArgumentException in Java:
```
throw new IllegalArgumentException(); // 37 characters
```
But there must be a shorter (as in less characters) ways to do so.
How can we produce a java.lang.IllegalArgumentException with even less code?
* The code fragment has to compile and run in java 7.
* No imports/external packages (e.g. not using `java.util.Arrays.toString()` )
	+ only exception: java.lang because it is automatically imported.
* You can add own
methods/classes.
* It must throw a java.lang.IllegalArgumentException
	+ **Edit:** the error output (stacktrace) must name it java.lang.IllegalArgumentException, so no subclasses of it.
To have a base to start from:
```
class Titled {
    public static void main(String[] args) {
        throw new IllegalArgumentException();
    }
}
```
  
[Answer]
These were all found by `grep`ping the source code in the package `java.lang`.
All of them result in a "pure" `IllegalArgumentException` (i.e. not a subclass of it).
The ones marked `*` only work if you add `" throws Exception"` (18 characters) to your `main` declaration, as they throw a checked exception of some kind.
## 12 (30?) characters\*
```
"".wait(-1);
```
This will result in:
```
java.lang.IllegalArgumentException: timeout value is negative
```
## 22 (40?) characters\*
```
new Thread().join(-1);
```
## 22 characters
```
Character.toChars(-1);
```
## 30 characters
```
Character.UnicodeBlock.of(-1);
```
[Answer]
Here's a nice short way to do it, in **~~17~~ 13 chars**:
```
new Long("");
```
It throws a `NumberFormatException`, which is an `IllegalArgumentException`. [This](http://docs.oracle.com/javase/7/docs/api/java/lang/IllegalArgumentException.html) and [this](http://ideone.com/5w3M9S) verify it.
Equivalently, one could do
```
new Byte("");
```
[Answer]
# 22 characters:
```
Character.toChars(-1);
```
[Running example](http://ideone.com/XrWA0t)  
Javadoc: [java.lang.Character.toChars(int)](http://docs.oracle.com/javase/7/docs/api/java/lang/Character.html#toChars%28int%29) 
**Some nice looking variants:**
```
Character.toChars(~4); // 22 characters, number can be any non-negative (and -0)
```
```
Character.toChars(1<<7); // 24 characters
```
`~i` is the same as `-1 * (i+1)` because it inverts the bits. So we will get a illegal parameter, because it is smaller then 0.  
`1<<7` will create a too high number by shifting the 1 seven times. (same as multiply it 7 times with 2). The last accepted Value seems to be `1114111`, `1114112` will fail. *Note:* this might change depending on your environment, and could be not always reliable.
See the [Oracle Docs "Bitwise and Bit Shift Operators"](http://docs.oracle.com/javase/tutorial/java/nutsandbolts/op3.html) and ["Primitive Data Types"](http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html)
# 28 characters:
And if you don't like using the character class in a character count competition\*:
```
Enum.valueOf(Enum.class,""); // 28 characters
```
*\*) Just to make this pun.*
[Answer]
# 21 characters:
```
System.getProperty("");
```
As per the documentation, `getProperty` and `setProperty` throw `IllegalArgumentException` if the key is empty.
[Answer]
# 25 Characters
Creates a vector with an invalid (negative) length:
```
new java.util.Vector(-1);
```
Displays:
```
Exception in thread "main" java.lang.IllegalArgumentException: Illegal Capacity: -1
    at java.util.Vector.<init>(Vector.java:129)
    at java.util.Vector.<init>(Vector.java:144)
    at Titled.main(Titled.java:3)
```
[Answer]
Here's 24 characters:
```
System.out.printf("%z");
```
This will throw an `IllegalFormatException`, which is an `IllegalArgumentException`.
[Answer]
# 19 characters:
```
String.format("%");
```
Throws `java.util.UnknownFormatConversionException`, which inherits from `IllegalFormatException`, which, in turn, inherits from `IllegalArgumentException`;
[Answer]
# **14 Characters**
```
this.wait(-1);
```
# **17 Characters**
```
Thread.sleep(-1);
```
As far as code that directly throws IllegalArgumentException, these will do it.
```
From documentation: 
Thread.sleep(int millis): 
Throws:IllegalArgumentException - if the value of millis is negative
InterruptedException - if any thread has interrupted the current thread. 
```
so direct code is 17 chars, if you're being a super stickler and counting the chars to add a throws clause for the interupted exception you can shorten it by just throwing the raw Exception class
]