Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

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
794 views