title: Accessing Kotlin Sealed Class from Java
body: <p>Up until now I have been using this Kotlin sealed class:</p>
  
  <pre><code>sealed class ScanAction {
     class Continue: ScanAction()
     class Stop: ScanAction()
     ... /* There's more but that's not super important */
  }
  </code></pre>
  
  <p>Which has been working great in both my Kotlin and Java code. Today I tried changing this class to use objects instead (as is recommended to reduce extra class instantiation): </p>
  
  <pre><code>sealed class ScanAction {
     object Continue: ScanAction()
     object Stop: ScanAction()
  }
  </code></pre>
  
  <p>I am able to reference this easy peasy in my other Kotlin files, but I am now struggling to use it in my Java files.</p>
  
  <p>I have tried the following and both of these kick back compilation errors when trying to make reference to in Java:</p>
  
  <pre><code>ScanAction test = ScanAction.Continue;
  
  ScanAction test = new ScanAction.Continue();
  </code></pre>
  
  <p>Does anyone know how I can reference the instance in Java now?</p>