⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 callableexample.java

📁 一步 教你学会java 完成一个完整的SWT系统 是本人学习java时按教程一步一步写下来的咯
💻 JAVA
字号:
/** *  Example code for JavaOne hands-on J2SE lab * *  Concurrency utilities (JSR-166) example **/package future;import java.net.*;import java.io.*;import java.util.concurrent.*;/** *  A simple implementation of the Callable interface that can return a value *  to the thread that started it **/public class CallableExample implements Callable<String> {  /**   *  The entry point called when this object is invoked as a new thread   *  of execution   *   * @returns A String as a simple result   **/  public String call() {    System.out.println("Starting call() method in second thread");    try {      Thread.sleep(500);    } catch (InterruptedException ie) {      // Ignore    }    System.out.println("Completed call() method in second thread");    return "Finished";  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -