title: Is there anything like an Objective-C block in Java?
body: <p>I'm just learning Java, and I've developed apps in Objective-C before. I like the concept of "blocks", because they allow code to be ran after something happens.</p>
  
  <p>For example, to execute a block after a certain amount of time in a SpriteKit app that calls a method <code>helloWorld</code> from scene <code>myScene</code>:</p>
  
  <pre><code>[myScene runAction:[SKAction sequence:@[[SKAction waitForDuration:5], [SKAction runBlock:^{
      [myScene helloWorld];
  }]]]];
  </code></pre>
  
  <p>Is there anything like a block in Java? If so, how would I use it? What's the syntax to...</p>
  
  <ul>
  <li>use it as a function parameter?</li>
  <li>call said block in the function?</li>
  <li>assign a value to the block?</li>
  </ul>
  
  <p>I've heard a little bit about "closures," but I'm not so sure what they are or how to use them.</p>