摘要: public static void main(String[] args) { //创建线程池,并指定线程池中线程的数量 ExecutorService pool = Executors.newFixedThreadPool(2); Runnable r = new Runnable() { @O 阅读全文
posted @ 2021-05-19 22:09 步江伍德 阅读(53) 评论(0) 推荐(0)
摘要: public static void main(String[] args) { // 数组中的元素必须是, 从小到大排序, int[] arr = {10, 20, 30, 40, 50, 60, 70, 80, 90}; int target = 55; System.out.println(b 阅读全文
posted @ 2021-05-17 00:22 步江伍德 阅读(30) 评论(0) 推荐(0)
摘要: public static void main(String[] args) { int[] arr = {5, 3, 2, 4, 1}; // 1. 外循环 长度 - 1 // 2. j从 i + 1开始 // 3. i 和 j进行比较 // 外循环, 比较长度 - 1 轮 for (int i 阅读全文
posted @ 2021-05-16 17:51 步江伍德 阅读(17) 评论(0) 推荐(0)
摘要: package com.programme.demo01; import java.util.Arrays; /** * @program: springboottest * @description: ${description} * @author: Mr.zw * @create: 2021- 阅读全文
posted @ 2021-05-16 17:20 步江伍德 阅读(20) 评论(0) 推荐(0)
摘要: package com.programme.demo01; import java.util.HashSet; import java.util.List; /** * @program: spring * @description: ${description} * @author: Mr.zw 阅读全文
posted @ 2021-05-15 16:41 步江伍德 阅读(313) 评论(0) 推荐(0)
摘要: package com.programme; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import 阅读全文
posted @ 2021-05-12 23:00 步江伍德 阅读(26) 评论(0) 推荐(0)
摘要: import ch.qos.logback.classic.spi.STEUtil; /** * @program: spring * @description: ${description} * @author: Mr.zw * @create: 2021-05-12 21:16 **/ publ 阅读全文
posted @ 2021-05-12 22:03 步江伍德 阅读(53) 评论(0) 推荐(0)
摘要: 内部类:将一个类A定义在另一个类B里面,里面的那个类A就称为内部类,B则称为外部类。 成员内部类 :定义在类中方法外的类。 访问特点: 1.内部类可以直接访问外部类的成员,包括私有成员。 2.外部类要访问内部类的成员,必须要建立内部类的对象。 /** * @program: spring * @de 阅读全文
posted @ 2021-05-12 21:09 步江伍德 阅读(57) 评论(0) 推荐(0)
摘要: 1.Spring Data JPA简介 Spring Data是一个用于简化数据访问,并支持云服务的开源框 使用完成Spring Data JPA对user表的CRUD操作。 2.步骤 1.创建工程勾选依赖 2.编写Pojo,添加注解 3.编写Dao(需要继承JpaRepository<T,ID>) 阅读全文
posted @ 2021-05-11 23:20 步江伍德 阅读(83) 评论(0) 推荐(0)
摘要: yield public static void yield() 对调度程序的一个暗示,即当前线程愿意产生当前使用的处理器。 调度程序可以自由地忽略这个提示。 产量是一种启发式尝试,以改善否则会过度利用CPU的线程之间的相对进度。 其使用应与详细的分析和基准相结合,以确保其具有预期的效果。 很少使用 阅读全文
posted @ 2021-05-11 14:59 步江伍德 阅读(231) 评论(0) 推荐(0)