what is the use of Inner class and Anynomus class ?

Hello everyoneI want to know that what is the use of Inner class and Anynomus class ?
[99 byte] By [Dhruvanga] at [2007-11-27 9:23:55]
# 1
http://java.sun.com/docs/books/tutorial/java/javaOO/nested.html
aniseeda at 2007-7-12 22:19:29 > top of Java-index,Java Essentials,Java Programming...
# 2

public void testMessageParserIncorrectMessageType() throws Exception {

UnprocessedDataMessage badMessage = new UnprocessedDataMessage() {};

try {

importer.parseMessage(badMessage);

fail("Expected an exception, got result");

} catch (MessageParserException e) {

// expected

}

}

Saves me having to define a class that's used for nothing except to make a method fail which makes the test pass :)

I'm sure there are other uses.

jwentinga at 2007-7-12 22:19:29 > top of Java-index,Java Essentials,Java Programming...