调用start() 方法时会执行run() 方法,为什么我们不能直接调用 run() 方法? 学习或者复习多线程的时候有没有问过自己这个问题呢? 首先需要知道线程的几个状态以及多线程工作方式。 new 一个Thread,线程进入了新建状态,调用start() 方法,会启动一个线程并使线程进入了就绪状 ...
分类:
其他好文 时间:
2021-04-26 13:45:38
阅读次数:
0
写一个java文件 public static void main(String[] args) { String str1="abc"; String str2 ="abc"; String str3=new String("abc"); boolean b1= str1==str2; boole ...
分类:
其他好文 时间:
2021-04-26 13:44:32
阅读次数:
0
CountDownLatch 减法计数器 官方定义:允许一个或多个线程等待直到在其他线程中执行的一组操作完成的同步辅助。 通俗理解:就是一个减法计数器,当减到值为0的时候才做某事。 常用方法: countDown 减一操作; await 等待计数器归零; 示例 :一个教室关门的案例(人走完(0)才能 ...
分类:
编程语言 时间:
2021-04-26 13:38:23
阅读次数:
0
--预备检查 BEGIN DBMS_REDEFINITION.CAN_REDEF_TABLE('GMSTEST','BGP_HSE_ENTITYHISTORY_NEW',DBMS_REDEFINITION.CONS_USE_PK); END; BEGIN DBMS_REDEFINITION.STAR ...
分类:
数据库 时间:
2021-04-26 13:35:17
阅读次数:
0
export const request = (url, method = "GET", data) => { let _url = `${baseUrlPrefix}${url}`; return new Promise((resolve, reject) => { Taro.showLoadin ...
分类:
其他好文 时间:
2021-04-26 13:33:10
阅读次数:
0
桥接模式 桥接模式结构图: 示例代码: // 桥接角色Message接口 public interface Message { void sendMessage(String message, String toUser); } // 具体Message角色Email public class Em ...
分类:
其他好文 时间:
2021-04-26 13:31:33
阅读次数:
0
思路: def new_ton(num): if num == 0: return 0 res = int(sqrt(num, num)) print(res) def sqrt(n, x): cur = (n + x/n) / 2 if cur == n: return cur else: ret ...
分类:
其他好文 时间:
2021-04-26 13:26:36
阅读次数:
0
var s1 = "hello" ; var s2 = new String("world") JavaScript String 对象: https://www.w3school.com.cn/jsref/jsref_obj_string.asp ...
分类:
Web程序 时间:
2021-04-26 13:24:50
阅读次数:
0
可变参数 一个方法中只能指定一个可变参数,它必须是方法的最后一个参数。任何普通的参数必须在它之前声明。 public class ChangeableParam { public static void main(String[] args) { double[] arr = new double[ ...
分类:
其他好文 时间:
2021-04-26 13:20:43
阅读次数:
0
与不含重复数字的全排列相比,在于: 排序; 添加对上一数字的判断 class Solution { LinkedList<List<Integer>> ans=new LinkedList<>(); LinkedList<Integer> path=new LinkedList<>(); boole ...
分类:
其他好文 时间:
2021-04-26 13:15:08
阅读次数:
0