@FunctionalInterfacepublicinterfaceRunnable { /** * When an object implementing interface <code>Runnable</code> is used * to create a thread, starting the thread causes the object's * <code>run</code> method to be called in that separately executing * thread. * <p> * The general contract of the method <code>run</code> is that it may * take any action whatsoever. * * @see java.lang.Thread#run() */publicabstractvoidrun();}
@FunctionalInterfacepublicinterfaceCallable<V> { /** * Computes a result, or throws an exception if unable to do so. * * @return computed result * @throwsException if unable to compute a result */Vcall() throwsException;}
classThreadimplementsRunnable {/* Make sure registerNatives is the first thing <clinit> does. */privatestaticnativevoidregisterNatives();static {registerNatives(); }...