摘要:
1 -- Create table 2 create table T_STUDENT 3 ( 4 sno VARCHAR2(3) not null, 5 sname VARCHAR2(8) not null, 6 ssex VARCHAR2(2) not null, 7 sbirthday DATE, 8 class ...
阅读全文
posted @ 2016-06-07 19:31
曦~妍
阅读(165)
推荐(0)
编辑
摘要:
1 package xiancheng; 2 import java.util.*; 3 public class Test1 extends Thread { 4 /*随便选择两个城市作为预选旅游目标。实现两个独立的线程分别显示10次城市名,每次显示后休眠一段随机时间(1000ms以内), 5 * 哪个先显示完毕,就决定去哪个城市。分别用Runnable接口...
阅读全文
posted @ 2016-06-04 09:57
曦~妍
阅读(281)
推荐(0)
编辑
摘要:
1 package xiancheng; 2 3 4 import java.util.Random; 5 6 public class Test2 implements Runnable { 7 8 @Override 9 public void run() { 10 11 city(); 12 13 ...
阅读全文
posted @ 2016-06-04 09:56
曦~妍
阅读(157)
推荐(0)
编辑
摘要:
1 package xiancheng; 2 3 public class Test5 implements Runnable{ 4 5 static int piaos=10; 6 public void run() 7 { 8 //卖票 9 while(true) 10 { 11...
阅读全文
posted @ 2016-06-04 09:52
曦~妍
阅读(157)
推荐(0)
编辑
摘要:
1 package xiancheng; 2 3 public class Test4 extends Thread{ 4 static int piaos=10; 5 public void run() 6 { 7 //卖票 8 // while(true) 9 // { 10 // try {
阅读全文
posted @ 2016-06-04 09:51
曦~妍
阅读(133)
推荐(0)
编辑
摘要:
synchronized在多线程中的使用 synchronized在多线程中的使用 synchronized在多线程中的使用 先看一个例子: //模仿火车售票系统,假设有4个售票点同时售票,我们可以把四个售票点定义为四个独立线程 class Test{ public static void main
阅读全文
posted @ 2016-06-04 09:40
曦~妍
阅读(146)
推荐(0)
编辑
摘要:
1 package jihe; 2 import java.util.*; 3 public class Emp { 4 5 private String e_id;//添加两个对象,并且将其私有化 6 private String e_name; 7 public Emp(String e_id,String e_name)//初始化私有对象 8 ...
阅读全文
posted @ 2016-06-01 10:00
曦~妍
阅读(199)
推荐(0)
编辑
摘要:
1 package shurushuchuliu; 2 import java.io.*; 3 public class Test5 { 4 5 public static void main(String[] args) { 6 try { 7 // 缓存的流 8 //匿名对象 9 1...
阅读全文
posted @ 2016-06-01 09:40
曦~妍
阅读(127)
推荐(0)
编辑
摘要:
1 package shurushuchuliu; 2 import java.io.*; 3 public class Test4 { 4 5 public static void main(String[] args) { 6 // 字符输出流 7 try{ 8 //准备File对象 9 Fi...
阅读全文
posted @ 2016-06-01 09:39
曦~妍
阅读(146)
推荐(0)
编辑
摘要:
1 package shurushuchuliu; 2 import java.io.*; 3 public class Test3 { 4 5 public static void main(String[] args) { 6 try { 7 // 准备文件对象 8 File file = ne...
阅读全文
posted @ 2016-06-01 09:24
曦~妍
阅读(171)
推荐(0)
编辑