replacement of lambda expression in java 1.7 -
timer.scheduleatfixedrate(() -> sendtimetoall(session),0,1,timeunit.seconds); this expression used in java 8, how write in java 7 version
the lambda () -> sendtimetoall(session) nothing more direct implementation of runnable-interface.
so () -> sendtimetoall(session) equivalent this
new runnable() { public void run() { sendtimetoall(session); } }
Comments
Post a Comment