title: Question about Java enums
body: <p>I have 2 files which are interacting with each other. I wanted to define an enum to make the code more readable, but if I define it in file 1, file 2 complains about having no knowledge of said enum. If I define ii in file 2, file 1 does the same. I am defining it as public too.</p>
  
  <p>The solution was to define the enum in both files,  but this doesn't seem right to me. Not only is it redundant, but I fear it may cause some conflict, even if the types have the same items.</p>
  
  <p>What is the veredict on this? Am I doing something wrong or worrying too much?</p>
  
  <p>EDIT</p>
  
  <p>Well, given the comments here I found an alternative which seems to be doing what I want without having to create a new file. I had:</p>
  
  <p>file 1</p>
  
  <pre><code>class myClass1
  {
      public enum MyEnum
      {
          ...
      }
      ...
  }
  </code></pre>
  
  <p>file 2</p>
  
  <pre><code>class myClass2
  {
      public enum MyEnum
      {
          ...
      }
      ....
  }
  </code></pre>
  
  <p>Now, I have:</p>
  
  <p>file 1</p>
  
  <pre><code>enum myEnum
  {
      ...
  }
  
  ...
  
  class myClass1
  {
       ...
  }
  </code></pre>
  
  <p>file 2</p>
  
  <pre><code>class myClass2
  {
       ...
  }
  </code></pre>
  
  <p>I didn't want to create another file just for the enum, so this works for me. Well, as long as there is nothing wrong with it, which I think there isn't.</p>