上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 25 下一页
摘要: 实现步骤: 创建 Callable 接口的实现类,并实现 call() 方法,该 call() 方法将作为线程执行体,并且有返回值。 创建 Callable 实现类的实例,使用 FutureTask 类来包装 Callable 对象,该 FutureTask 对象封装了该 Callable 对象的 阅读全文
posted @ 2019-08-15 18:35 李艳艳665 阅读(337) 评论(0) 推荐(0) 编辑
摘要: 步骤: 创建线程池对象创建 Runnable 接口子类对象提交 Runnable 接口子类对象关闭线程池实例: class TaskRunnable implements Runnable{ @Override public void run() { for (int i = 0; i < 10; 阅读全文
posted @ 2019-08-15 18:35 李艳艳665 阅读(973) 评论(0) 推荐(0) 编辑
摘要: 步骤: 创建线程池对象创建 Callable 接口子类对象提交 Callable 接口子类对象关闭线程池实例: class TaskCallable implements Callable<Integer> { @Override public Integer call() throws Excep 阅读全文
posted @ 2019-08-15 18:35 李艳艳665 阅读(297) 评论(0) 推荐(0) 编辑
摘要: 步骤 定义一个Thread子类;覆盖run方法(线程执行事件方法);创建该线程的一个实例:Thread t=new MyThread(http://www.amjmh.com/v/BIBRGZ_558768/);启动线程t1.start;实例: public class Main3 extends 阅读全文
posted @ 2019-08-15 18:34 李艳艳665 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 步骤 定义一个实现Runable接口的类,在类中实现run()方法(线程执行事件的方法)。创建一个上述类的对象:Thread t=new Thread(new MyThreadt.start());调用start 方法:t.start();实例: public class Main2 impleme 阅读全文
posted @ 2019-08-15 18:34 李艳艳665 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 软件版本:Spring Boot 2.1.6+Flink1.6.1+JDK1.8 程序主体: @SpringBootApplicationpublic class HadesTmsApplication implements CommandLineRunner { public static voi 阅读全文
posted @ 2019-08-15 13:47 李艳艳665 阅读(9313) 评论(0) 推荐(0) 编辑
摘要: public interface UserCrudRepository extends CrudRepository<User, Long> {}12UserCrudRepositoryTests: @RunWith(SpringRunner.class)@SpringBootTestpublic 阅读全文
posted @ 2019-08-13 17:06 李艳艳665 阅读(168) 评论(0) 推荐(0) 编辑
摘要: /** * 他是具有分页和排序的功能 同时继承了 CrudRepository */public interface UserPageRepository extends PagingAndSortingRepository<User,Long> {}12345UserPageRepositoryT 阅读全文
posted @ 2019-08-13 17:06 李艳艳665 阅读(106) 评论(0) 推荐(0) 编辑
摘要: /** * 不仅继承了 PagingAndSortingRepository 同时继承了 QueryByExampleExecutor(示例匹配器) */public interface UserJpaRepository extends JpaRepository<User, Long> {}12 阅读全文
posted @ 2019-08-13 17:06 李艳艳665 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 步骤: 创建线程池对象创建 Callable 接口子类对象提交 Callable 接口子类对象关闭线程池实例: class TaskCallable implements Callable<Integer> { @Override public Integer call() throws Excep 阅读全文
posted @ 2019-08-13 17:05 李艳艳665 阅读(165) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 25 下一页