title: How to hold an image in an enum in Java?
body: <p>As far as I understood you can put basically any kind of object inside an <code>enum</code>, this would include a <code>BufferedImage</code>.<br>
  This would mean that creating an <code>enum</code> as follows should work:</p>
  
  <pre><code>A(0 , ImageIO.read(new File("a.png")) , "foo" , true),
  B(1 , ImageIO.read(new File("b.png")) , "" , true);
  </code></pre>
  
  <p>The problem is that you <strong>have</strong> to catch any exceptions with this way of creating a <code>BufferedImage</code>.</p>
  
  <p>Now my question is:<br>
  Is is possible to place a <code>try/catch</code> <strong>inside</strong> the declaration of the <code>enum</code>, or should I just hold the file name and pass the actual <code>BufferedImage</code> when it's being requested?</p>