/** * 定义馒头类 */ 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(); } }
问题 在主方法中声明两个存取馒头的时候,要对存取馒头两个类进行增加有参构造方法而不能使用默认无参构造方法才能正常,如果使用无参构造方法时,程序会阻塞?为什么?这块不太理解
老师可以把这个项目的 API 打包发出来不 0-0
老师,我也想知道怎么回事,明明是给usres表加的salt,怎么在Admin实体类里加了salt?
num=0
sum_all=0
while num<=100:
sum_all=sum_all+num
num+=1
print("1-100所有数字的累加和:"+str(sum_all))
print("1-100所有数字的累加和:",sum_all)
print("1-100所有数字的累加和:"+str(sum_all))和print("1-100所有数字的累加和:",sum_all)这里面逗号和加号的区别是什么,为什么加号就要加一个str
我配置了环境变量,还是有问题,不能创建环境,谢谢
为什么按照老师的代码敲得我这里报错 找不到a包?
在b包里导入a包的内容应该有路径相关的的问题啊
在test03里写
import a.aa.module_AA a.aa.module_AA.fun_AA()
就没有问题在module_B1里写
from ..a.aa.module_AA import fun_AA
也没有问题
就是在module_B1里写
import a.aa.module_AA
不行
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>02_Ajax中post参数的传递</title> </head> <body> <h1>02_Ajax中post参数的传递</h1> name:<input type="text" id="name" /></body></br> passwd:<input type="password" id="pwd" /> </br> <input type="button" value="获取数据" onclick="sub()" /> <script> function sub(){ var name=document.getElementById("name").value var pwd=document.getElementById("pwd").value url='http://httpbin.org/get' params='name='+name+'&pwd='+pwd var xhr=new XMLHttpRequest() xhr.open('post',url) xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded') xhr.send(params) xhr.onload=function(){ console.log(xhr.responseText) } } </script> </body> </html>
老师 这个参数传递 是传递在哪里了 这个有什么作用 没有听明白
还有一个 这个表单数据跟之前都不一样 老师一直在讲这个 这个有什么用 为什么get跟post两个不一样
发现我刚才提问的,在52节课详细说明了
老师。我JDK安装的版本为13,但是安装IDEA时,它自动设置为版本,请问怎么更改配置?
老师 为什么我的代码运行后 不跳出小屏幕呢
老师主线程如果不主动去让它进入阻塞状态它会自动结束的吗
老师,有两个问题:一个是增加外键一定要参考另一个表的主键吗?
第二个问题:alter table dept50 add constraint dept50_d_id foreign key(d_id) references dept60(id);
这个是可以运行的,当我在dept增加salary列,把add关键字换成modify就不能运行了
alter table dept50 modify constraint dept_d foreign key(salary) references dept60(id);
它就提示命令未正确结束,这个报错是因为什么,换关键字的原因吗?
什么时候能把噪音问题处理一下呀 声音都很难分辨了
这个页面出现报错。麻烦看一下。老师,我这个报错,看了看不太明白
老师,这里insert里的第一个参数为什么是INSERT,不应该是索引(数字)吗
非常抱歉给您带来不好的体验!为了更深入的了解您的学习情况以及遇到的问题,您可以直接拨打投诉热线:
我们将在第一时间处理好您的问题!
关于
课程分类
百战程序员微信公众号
百战程序员微信小程序
©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园网站维护:百战汇智(北京)科技有限公司 京公网安备 11011402011233号 京ICP备18060230号-3 营业执照 经营许可证:京B2-20212637