皮皮学,免费搜题
登录
logo - 刷刷题
搜题
【简答题】
请完成下列Java程序:假设某家银行,它可接受顾客的汇款,每做一次汇款,便可计算出汇款的总额。现有两个顾客,每人3次,每次50入。编写一个程序,模拟实际作业。要求实现2个类,一个是银行类,一个是顾客类。 注意:请勿改动main()主方法和其他已有语句内容,仅在下划线处填入适当的语句。 程序运行结果如下: Customer2 :sum= 50 Customer1 :sum= 50 Customer1 :sum= 100 Customer2 :sum= 100 Customer1 :sum= 150 Customer2 :sum= 150 class bank{ private static int sum=0; public static void add(int.n,char c){ int tmp=sum; ______________; try{ Thread.sleep(((int) ((2000-500+1)*(Math.random())))+500); } catch(InterruptedException e){} sum=tmp; System.out.println('Customer'+c+' :sum= '+sum); } } class customer extends Thread{ static char flag17_2 = '1'; public void run(){ char myflag17_2; synchronized(this) { myflag17_2 = flag17_2++; } for(int i=1;i<=3;i++) ______________________; } } public class ex17_2{ public static void main(String args[]){ customer c1=new customer(); customer c2=new customer(); c1.start(); c2.start(); } }
手机使用
分享
复制链接
新浪微博
分享QQ
微信扫一扫
微信内点击右上角“…”即可分享
反馈
参考答案:
举一反三
【单选题】盘古开辟天地用的工具是( )
A.
B.
C.
D.
【单选题】关于解离平衡的说法,不正确的是?
A.
盐酸不存在解离平衡。
B.
一旦达到解离平衡,解离度就不会受外界条件的影响了。
C.
解离平衡是一种动态平衡状态。
D.
当醋酸溶液达到解离平衡时,其pH值就稳定了。
【单选题】Which of the following does NOT describe the rival parties' opinion on the relocation?
A.
Feasible.
B.
Impractical.
C.
Unpopular.
D.
Inefficient.
【单选题】盘古开辟天地用的工具是
A.
B.
C.
D.
【单选题】Which of the following is calculated by adding the average advertising costs for job postings, agency fees, recruiter's salary and benefits, and relocation expenses for new employees?
A.
turnover cost
B.
cost per hire
C.
cost of attrition
D.
retention cost
【单选题】盘古开辟天地用的工具是( )
A.
B.
C.
D.
【判断题】Changes in job design may include: job sharing, rings of defense, bumping, and job relocation.
A.
正确
B.
错误
【判断题】Job relocation is one way of achieving job design
A.
正确
B.
错误
【多选题】下列情况下会产生可抵扣暂时性差异的是(    )
A.
资产的账面价值大于计税基础
B.
资产的账面价值小于计税基础
C.
负债的账面价值大于计税基础
D.
负债的账面价值小于计税基础
【判断题】资产的账面价值大于资产的计税基础产生的暂时性差异是应纳税暂时性差异。
A.
正确
B.
错误
相关题目:
参考解析:
知识点:
题目纠错 0
发布
创建自己的小题库 - 刷刷题