老师您好,我想问一下:“学有余力同学,自己搭建高并发模拟场景,对服务器做简单的压力测试,并通过调整参数和代码提高并发处理量。”这个作业是怎么做?我不太懂高并发模拟场景是如何搭建的?或者说,这个作业的要求具体是干什么?要达到什么条件才算是合格?能不能给我解析的详细一些?
老师,为什么这个只有一个客户端有反应,
新建文件夹 (3).rar
老师想问一下a与b完全没有交集的时候,差集会失败吗,会返回false吗
老师好,能够找到项目的所在目录和.java文件,下载了给的反编译工具想试试,.class文件怎么找
老师,我这个前面三行read()的和我write()的东西不一样,到readUTF();的时候直接报错了。
ArrayList<String> a = new ArrayList<>(); List<String> c = new ArrayList<>(); a.add("a"); a.add("b"); a.add("c"); c.add("2233"); c.add("啥的"); c.add("dd"); c.addAll(a); for(String shuzu:c){ System.out.println(shuzu); }
老师请问一下ArrayList<String> 和List<String>创建列表有什么区别呢?
但它们俩都可以相互并集,说明是一样的,只是习惯性的简写。还是说这两之间有什么细小的差别呢?
声音太小了 听着真难受!!!!!!!!!!!!!!!!!!!!
老师,我导了一个项目进eclipse,但是现在出现了这种情况,缺少的这是什么东西啊?怎么解决?
老师,这样敲:
int buf = 0; // 储存读到的字节 while( (buf = fis.read()) != -1){ System.out.print((char)buf+" "); }
返回的是:a b c d e f
为什么这样
while( fis.read() != -1){ System.out.print((char)fis.read()+" "); }
返回的是:b d f?
我创建的文件里面内容是adcdef
public static void main(String[] args) { System.out.println("主线程开始"); StopThread st = new StopThread(); Thread t = new Thread(st); t.start(); try { //从键盘输入,使主线程进入阻塞状态 System.in.read(); }catch (Exception e){ e.printStackTrace(); } st.stop();//结束线程 System.out.println("主线程结束"); }
老师为什么是从键盘输入,才能使主线程进入阻塞状态
hashset中的链表是单向链表么?!!!!!!!!!
什么时候先建立输出流,什么时候先建立输入流,我看前面很多都是先建立Input和Reader型
/** * 定义馒头类 */ class mantou2{ private int id ; public int getId() { return id; } public void setId(int id) { this.id = id; } public mantou2(int id) { this.id = id; } } /** * 定义缓冲区 */ class buffer{ private mantou2[] mt = new mantou2[10]; private int index ; /** * 放馒头 */ public synchronized void push(mantou2 mantou2){ while (this.index == this.mt.length){ try { wait(); } catch (InterruptedException e) { e.printStackTrace(); } } notify(); this.mt[index] = mantou2 ; index++ ; } /** * 取馒头 */ public synchronized mantou2 pop(){ while (this.index == 0){ try { wait(); } catch (InterruptedException e) { e.printStackTrace(); } } notify(); this.index--; return this.mt[index] ; } } /** * 取馒头线程 */ class qumantou extends Thread{ buffer buffer = new buffer(); public qumantou(com.itbz.buffer buffer) { this.buffer = buffer; } @Override public void run() { for (int i = 0; i < 10;i++){ buffer.pop() ; System.out.println("取馒头" + i); } } } /** * 放馒头线程 */ class cunmantou extends Thread{ buffer buffer = new buffer(); public cunmantou(com.itbz.buffer buffer) { this.buffer = buffer; } @Override public void run() { for (int i = 0; i < 10;i++){ System.out.println("存馒头" + i); mantou2 mantou2 = new mantou2(i); buffer.push(mantou2); } } } public class ProductThread2 { public static void main(String[] args) { buffer buffer = new buffer(); cunmantou cunmantou = new cunmantou(buffer); qumantou qumantou = new qumantou(buffer); cunmantou.start(); qumantou.start(); } }
问题 在主方法中声明两个存取馒头的时候,要对存取馒头两个类进行增加有参构造方法而不能使用默认无参构造方法才能正常,如果使用无参构造方法时,程序会阻塞?为什么?这块不太理解
老师主线程如果不主动去让它进入阻塞状态它会自动结束的吗
老师,我想问一下这个上课课件的文档有吗?
非常抱歉给您带来不好的体验!为了更深入的了解您的学习情况以及遇到的问题,您可以直接拨打投诉热线:
我们将在第一时间处理好您的问题!
关于
课程分类
百战程序员微信公众号
百战程序员微信小程序
©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园网站维护:百战汇智(北京)科技有限公司 京公网安备 11011402011233号 京ICP备18060230号-3 营业执照 经营许可证:京B2-20212637