即使子线程休眠了,也不去抢cpu资源,等子线程做完了主线程再做; public class Test5 { public static void main(String[] args) { MyRunnable2 r = new MyRunnable2(); Thread t = new Threa ...
分类:
其他好文 时间:
2019-12-29 15:06:59
阅读次数:
61
题号 题目链接 说明 基础 27 Remove Element 26 Remove Duplicates from Sorted Array 80 Remove Duplicates from Sorted Array II 277 Find the Celebrity 189 Rotate Arr ...
分类:
其他好文 时间:
2019-12-29 12:57:11
阅读次数:
77
在根目录上创建一个vue.config.js文件 const path = require("path"); const resolve = function(dir) { return path.join(__dirname, dir); }; module.exports = { publicP ...
分类:
移动开发 时间:
2019-12-29 11:11:55
阅读次数:
81
package com.example.demo.utils;import java.lang.reflect.Field;import java.util.concurrent.*;public class Test1 { static ThreadLocal threadLocal = new ...
分类:
编程语言 时间:
2019-12-29 11:07:00
阅读次数:
116
目录 Python文件IO操作 上下文管理with 路径操作 01 Python文件IO操作: |clumn| column| | | | |open| 打开 | |read| 读取| |write | 写入 | |close | 关闭 | |readline| 行读取| |readlines | ...
分类:
编程语言 时间:
2019-12-28 20:49:39
阅读次数:
205
方法有以下几种: 主线程等待法 使用Thread类的join()阻塞当前线程以等待子线程处理完毕 通过Callable接口实现: 通过FutureTask Or线程池获取 一、主线程等待法 如下代码 打印的结果为 将它改造成主线程等待法 这样,5秒后就能打印name的值 二、使用Thread类的jo ...
分类:
编程语言 时间:
2019-12-28 20:43:56
阅读次数:
92
1 import threading, time 2 3 class Test(): 4 def test1(self): 5 print("--") 6 time.sleep(3) 7 print(" ") 8 9 10 def test2(self): 11 print("==") 12 tim ...
分类:
编程语言 时间:
2019-12-28 09:36:36
阅读次数:
92
1 多表关联查询 从快速入门,我们已经学会了如何在一张表中读取数据,这是最基础简单的查询表中的数据,但是在实际中经常需要从多个表中读取数据。 本章我将会向大家介绍如何使用MySQL在多个表中查询数据。 想要从多个表中查找数据,就要用到JOIN关键字 JOIN 按照功能大致分为如下三类: 1.CROS ...
分类:
数据库 时间:
2019-12-27 23:34:38
阅读次数:
103
什么是多表关联查询? 根据多表连接查询返回的结果,分为三类 内连接(inner join) 外连接(outer join) 交叉连接( cross join) 交叉链接 交叉连接的关键字:CROSS JOIN 交叉连接的表现:行数相乘、列数相加 交叉连接(笛卡尔积)返回被连接的两个表所有数据行的笛卡 ...
分类:
数据库 时间:
2019-12-27 21:45:04
阅读次数:
80
一、字符串基础 1、基础而不常用的方法 1 Join:合并字符串数组,创建 一个新的字符串 2 PadLeft:在字符串的左侧,通过添加指定的重复字字符填充字符串 3 PadRight:在字符串的右侧,通过添加指定的重复字字符填充字符串 4 Compare:比较字符串的内容,考虑区域值背景 5 Co ...
分类:
其他好文 时间:
2019-12-27 18:19:37
阅读次数:
121