上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 25 下一页
摘要: 线程通信:及线程交互 用到的方法 wait(),notify()/notifyAll();wait():让当前线程进入阻塞状态,并释放锁。notify():唤醒一个被wait()的线程,如果多个线程,唤醒优先级最高的。notifyAll():唤醒所有被wait()的线程。注意: wait()、not 阅读全文
posted @ 2020-03-28 19:42 玄空2 阅读(135) 评论(0) 推荐(0) 编辑
摘要: package thread;import java.util.concurrent.locks.ReentrantLock;/** * @auto dh * @create 2020-03-28-13:07 */class Account { private Double balance; pri 阅读全文
posted @ 2020-03-28 13:36 玄空2 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 来自尚硅谷视屏 package thread;public class Thread004 { public static void main(String[] args) { StringBuffer sf=new StringBuffer(); StringBuffer sf2=new Stri 阅读全文
posted @ 2020-03-28 11:35 玄空2 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 创建方式: 父类 引用名=new 父类(){ 重写父类方法 } 示例: class T018 { public void run() { System.out.println("hello world"); }}public class Test018 { public static void ma 阅读全文
posted @ 2020-03-26 20:12 玄空2 阅读(427) 评论(0) 推荐(0) 编辑
摘要: /** * @auto dh * @create 2020-03-25-15:16 */public class StringTest { public static void main(String[] args) { long startTime = 0L; long endTime = 0L; 阅读全文
posted @ 2020-03-25 15:26 玄空2 阅读(313) 评论(0) 推荐(0) 编辑
摘要: String:不可变字符序列,顶层char[] 修饰符 final StringBuffer:可变字符序列,线程安全,效率低 。 底层 char[] 无参初始容量为16 StringBuilder:可变字符序列,线程不安全,效率高 。 底层 char[] 无参初始容量为16 StringBuffer 阅读全文
posted @ 2020-03-25 15:07 玄空2 阅读(140) 评论(0) 推荐(0) 编辑
摘要: public class StringBufferBuilderTest { public static void main(String[] args) { StringBuffer sf=new StringBuffer();// 用于字符串拼接 sf.append("abc"); sf.app 阅读全文
posted @ 2020-03-25 15:00 玄空2 阅读(1051) 评论(0) 推荐(0) 编辑
摘要: create table student_test( sid int, 学生ID tid int, 试题ID score float,得分 flag int,是否正确 stid int 试卷ID)学生表create table student( id int, //学生id name varchar 阅读全文
posted @ 2020-03-24 20:30 玄空2 阅读(300) 评论(0) 推荐(0) 编辑
摘要: 结论:常量与常量的拼接结果在常量池,且常量池中不会存在相同内容的常量。 只要其中有一个是变量,结果就在堆中。 如果拼接结果调用intern()方法,返回值就在常量池中。 // 示例 import org.junit.Test;/** * @auto dh * @create 2020-03-24-1 阅读全文
posted @ 2020-03-24 12:28 玄空2 阅读(1016) 评论(0) 推荐(0) 编辑
摘要: 来自尚硅谷视屏/** * @auto dh * @create 2020-03-22-15:09 */interface A{ int x=1;}class B{ int x=2;}class C extends B implements A{ public void run(){// 类于接口处于 阅读全文
posted @ 2020-03-22 15:15 玄空2 阅读(198) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 25 下一页