HELP!!! Error "code too large"
Hello, I am working on a program that has become very large... and apparently it is too large now...
When I try to compile the program it generates an error, "code too large", the code has exceeded 10000 lines and now I dont know what to do. Anyone that has any ideas? Thankful for any response...
[317 byte] By [
Freddef] at [2007-9-30 6:38:33]

Good heavens 10000 lines, in one method or what?It's called:Refactor your code into smaller methods, which should be done regardless of this error, for greater readability and maintainability and OOP principles.
> Actually there is several small methods, not just> one... and I dont know what else to do...Refactor into smaller classes too, not have one or more big monolithic classes which are probably doing too much.
There are 64k limits on several things (code per methods, constants, etc). See the end of this page: http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.htmland then break your code up into smaller pieces.
Let's say, for instance, that I wnat to initialize an array instance variable that will contain 7462 integer values in my constructor, just as an example. I'm not really sure if this exceeds the maximum size for a java array, but if it does that would be just as useless a restriction as this "code too large" thing. If I write huge code that means I need huge code. [ goes to write program in C, which would be my advice here. :) ]
You went to the trouble of registering in order resurrect a three-year-old thread by posting a pointless, misinformed, content-less response.Who are you people?Grant