title: Changing Enum at Runtime Java
body: <p>Is there any way to add elements to a built in enum class in Java?</p>
  
  <p>My question is similar to <a href="https://stackoverflow.com/questions/478403/can-i-add-and-remove-elements-of-enumeration-at-runtime-in-java">Can I add and remove elements of enumeration at runtime in Java</a>, but that question seems to be geared towards constructing your own enum and then modifying it. I'm assuming there's an existing enum somewhere I can't change, something like</p>
  
  <pre><code>enum Days{ MONDAY, TUESDAY, WEDNESDAY }
  </code></pre>
  
  <p>and I want to add Thursday, Friday, etc. to it. So unfortunately, suggestions of how to use an interface to accomplish my goal, or other methods that would be more effective than enums, don't apply here.</p>
  
  <p>As I understand it, enums are implicitly final, so I can't extend it and add more elements to it. It has private fields, but it appears I can use reflection to access those - could I change one of the private fields, even if I can't add a new one, i.e, change Monday to Thursday?</p>
  
  <p><strong>Edit: Clarification of Circumstances</strong></p>
  
  <p>People have suggested altering the code before it's compiled into the program. My code is part of a larger project that I can't change; the class with the enum in it is loaded by the larger program before my class gets access to it. At that point, I'd like to add the missing elements to the enum. Is bytecode manipulation still the way to go?</p>