老师这个for里面的表示什么啊?s是什么意思?
+a+的意思是先把a赋值输出,然后再算自增吗?
老师,之前说python里边一切皆对象,那下边红色部分的se=Semaphore是等号左边的变量se是“信号量对象”,还是右边的`Semaphore是“信号量对象”呢?
这是怎么回事
老师 Java中module和package的区别是什么 我好懵
用be切割为什么不是['to','or','not','to','']或者['to',‘‘,'or','not','to','']?
回答区的回答我没看懂 老师
老师设置了优先级队列为什么不按队列顺序来呀,我生产消息的时候就是一个for循环从1-10,为甚么出现这种情况。
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> .container { width: 1400px; margin: 0 auto; background-color: aqua; } .header { height: 80px; background-color: #abcdef; } .nav { margin-top: 10px; height: 80px; background-color: #adadad; } .main { width: 600px; margin-top: 10px; background-color: #aaac; } .left{ float: left; width: 900px; height: 600px; background-color: #abcdef; } .right{ float: right; width: 480px; height: 600px; background-color: #abcdcc; } </style> </head> <body> <div class="container"> <div class="header">网站头部</div> <div class="nav">网站导航</div> <div class="main"> <div class="left">主要内容</div> <div class="right">侧边栏</div> </div> <div class="footer">网站底部</div> </div> </body> </html>
老师我侧边栏过不去啊
老师项目路径怎么配呢?之前在servlet的时候是http://localhost:8080/servletdemo/hello.do,
现在用maven访问少了一个项目路径
http://localhost:8080/hello.do
为什么在db.properties中写数据库驱动呢?maven会帮忙加载驱动吗?还有jdbc.url为什么是三条杠?
老师这个i是哪里来的,创建线程的时候没有传递参数呀。
老师 这里为什么设计y=30和50?变化的不是x的值吗?、
老师,为啥我使用接口后,这个线程名没有修改成功喃?
package DemoThread; //线程同步现象 class Acount{ private String accountNo; private double balance; public Acount(String accountNo, double balance) { this.accountNo = accountNo; this.balance = balance; } public Acount() { } public String getAccountNo() { return accountNo; } public void setAccountNo(String accountNo) { this.accountNo = accountNo; } public double getBalance() { return balance; } public void setBalance(double balance) { this.balance = balance; } } class DrawThread implements Runnable{ private Acount acount; private double drawMoney; public DrawThread() { } public DrawThread(String name, Acount acount, double drawMoney) { new Thread().setName(name); this.acount=acount; this.drawMoney=drawMoney; } @Override public void run() { if(this.acount.getBalance()>=this.drawMoney){ System.out.println(Thread.currentThread().getName()+" 取钱成功! 吐出钞票:"+this.drawMoney); try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } this.acount.setBalance(this.acount.getBalance()-this.drawMoney); System.out.println("\t 余额为:"+this.acount.getBalance()); }else { System.out.println(Thread.currentThread().getName()+" 取钱失败,余额不足"); } } } public class DrawMoneyThreadTest { public static void main(String[] args) { Acount acount=new Acount("1234",1000); new Thread(new DrawThread("老公",acount,800)).start(); new Thread(new DrawThread("老婆",acount,800)).start(); } }
同样的结果写法区别好大?不这样写就报错
非常抱歉给您带来不好的体验!为了更深入的了解您的学习情况以及遇到的问题,您可以直接拨打投诉热线:
我们将在第一时间处理好您的问题!
关于
课程分类
百战程序员微信公众号
百战程序员微信小程序
©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园网站维护:百战汇智(北京)科技有限公司 京公网安备 11011402011233号 京ICP备18060230号-3 营业执照 经营许可证:京B2-20212637