Forum Stats

  • 3,826,348 Users
  • 2,260,631 Discussions
  • 7,896,912 Comments

Discussions

Method references to a variable instance

I'm trying to find out why this works:

Runnable renderer = () -> activeGame.updatePositions();

yet this doesn't:

Runnable renderer = activeGame::updatePositions;

I thought the 2 were supposed to be equivalent? Or are method references intended to be "static" (they don't re-evaluate the activeGame variable every time).