I have a code base and some methods are never used.
Does javac remove the unused methods from the class file?
I have a code base and some methods are never used. Does javac remove
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Q: I want to know if I have a code base and some methods are never used. Does javac remove the unused methods from the class file?
A: No. What goes into the class, stays in the class file.
… however …
The JVM loads only what’s needed into memory. RAM isn’t “wasted” on unused classes.