Skip to Main Content

Method references to a variable instance

svanimpeMay 1 2014

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).

Comments
Post Details
Added on May 1 2014
0 comments
734 views