This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Max size of java class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Max size of java class" Watch "Max size of java class" New topic

Max size of java class

Paul Doherty

Joined: Jan 11, 2001
Posts: 11
What is the maximum size(in kilobytes) a java class can be? Indeed can a class be any size?
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
In theory there is no limit, however a particular machine may throw an OutOfMemoryError if there is not enough memory to completely load the class.
Rob Ross

Joined: Jan 07, 2002
Posts: 2205
Well there are actually practical limits on a variety of entities, like size of identifier names, numbers of methods, limits on parameter lists, etc; So there are upper limits on how big a class file can be.
Details here:
(Thanks to zakaria haque for the link)
[ March 12, 2002: Message edited by: Rob Ross ]

SCJP 1.4
It is sorta covered in the JavaRanch Style Guide.
subject: Max size of java class
Similar Threads
Inheritance --- Assigning Sub class Object to Super Class Reference
Such thing as dynamic array's in java?
size of a blank class
An error in K&B certification book
size of a file