Thursday, January 04, 2007

A very interesting dicussion was on at the Java Forums - How many methods can be stuffed into a Java Class ?

One of the replies from Rene Chennault was that the Class File Specification limits this to 2^16. I was curious to know where this information was & I asked in the Thread. The reply was to check this link :-

http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html

The "u2 methods_count;" is the key - u2 means 2 Bytes.

The complete Forum Thread is at this link :-

http://forum.java.sun.com/thread.jspa?threadID=5121112