在线考试系统完整代码,JAVA源码,供参考用,全部功能需要自己改错误


环境:jdk1.6以上,oracle,myeclipse...............................................................
资源截图
代码片段和文件信息
package com.briup.test.bean;


public class PriorityTest implements Runnable{

private long count;
private Thread t;
private boolean flag;//控制开始和停止的变量
public PriorityTest(int priority){
t = new Thread(this);
t.setPriority(priority);
}
public void start(){
flag = true;
t.start();
}
public void stop(){
flag = false;
}
public void join()throws Exception{
t.join();
}
public void getCount(){
System.out.println(count);
}
public void run(){
while(flag){
count++;
}
}
public static void main(String args[]){
PriorityTest p1 = new PriorityTest(Thread.NORM_PRIORITY);
//PriorityTest p2 = new PriorityTest(Thread.NORM_PRIORITY);
PriorityTest p2 = new PriorityTest(Thread.NORM_PRIORITY-1);
p1.start();
p2.start();

try{
Thread.currentThread().sleep(1000);
p1.stop();
p2.stop();
p1.join();
p2.join();
}catch( Exception e){
e.printStackTrace();
}
p1.getCount();
p2.getCount();
}


}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-04-22 22:55  考试系统
     目录           0  2018-04-22 22:51  考试系统mytest
     文件       65536  2018-04-22 22:54  考试系统mytest.DMP
     文件        4323  2018-04-22 22:51  考试系统mytest.classpath
     文件         433  2018-04-22 22:51  考试系统mytest.myhibernatedata
     文件         291  2018-04-22 22:51  考试系统mytest.mymetadata
     文件         254  2018-04-22 22:51  考试系统mytest.mystrutsdata
     文件        1697  2018-04-22 22:51  考试系统mytest.project
     目录           0  2018-04-22 22:51  考试系统mytest.settings
     文件         500  2018-04-22 22:51  考试系统mytest.settings.jsdtscope
     文件         352  2018-04-22 22:51  考试系统mytest.settingsorg.eclipse.core.resources.prefs
     文件          83  2018-04-22 22:51  考试系统mytest.settingsorg.eclipse.core.runtime.prefs
     文件          49  2018-04-22 22:51  考试系统mytest.settingsorg.eclipse.wst.jsdt.ui.superType.container
     文件           6  2018-04-22 22:51  考试系统mytest.settingsorg.eclipse.wst.jsdt.ui.superType.name
     目录           0  2018-04-22 22:51  考试系统mytestsrc
     目录           0  2018-04-22 22:51  考试系统mytestsrccom
     目录           0  2018-04-22 22:51  考试系统mytestsrccomriup
     目录           0  2018-04-22 22:51  考试系统mytestsrccomriup est
     文件         265  2018-04-22 22:51  考试系统mytestsrccomriup estApplicationResources.properties
     目录           0  2018-04-22 22:51  考试系统mytestsrccomriup estean
     目录           0  2018-04-22 22:51  考试系统mytestsrccomriup esteanexam
     文件        1037  2018-04-22 22:51  考试系统mytestsrccomriup esteanexamAjaxjsf.hbm.xml
     文件        1244  2018-04-22 22:51  考试系统mytestsrccomriup esteanexamAjaxjsf.java
     文件        1133  2018-04-22 22:51  考试系统mytestsrccomriup esteanexamBanji.hbm.xml
     文件        1406  2018-04-22 22:51  考试系统mytestsrccomriup esteanexamBanji.java
     文件        1400  2018-04-22 22:51  考试系统mytestsrccomriup esteanexamChengji.hbm.xml
     文件        1956  2018-04-22 22:51  考试系统mytestsrccomriup esteanexamChengji.java
     文件        1028  2018-04-22 22:51  考试系统mytestsrccomriup esteanexamEjb.hbm.xml
     文件        1244  2018-04-22 22:51  考试系统mytestsrccomriup esteanexamEjb.java
     文件         645  2018-04-22 22:51  考试系统mytestsrccomriup esteanexamExamstate.hbm.xml
     文件         790  2018-04-22 22:51  考试系统mytestsrccomriup esteanexamExamstate.java
............此处省略541个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)