java 请问如何移除已经建立的账号?(已附部分代码)

不要睡觉 2019-11-03 12:14:09
	 //Check we are opening the account with a valid amount
if(openAmount >= 0.0)
{
try
{
//Create a Saving account for the customer with the openAmount
Account theAccount = new Savings(openAmount, theCustomer);
addAccount(theAccount);
return true;
}catch(AccountException e)
{

这个是加账户
请问移除账户怎么写呀qwq

public boolean closeAccount(Customer theCustomer, double theAmount)
{
if(rmAccount = 0.0)
{
try
{}

}
return true;
...全文
68 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
不要睡觉 2019-11-03
  • 打赏
  • 举报
回复
请问是直接吗
  rmAccount(theAccount);
                 return true;
SZ深呼吸 2019-11-03
  • 打赏
  • 举报
回复
添加移除都是需要你自己去实现的,你添加到哪里了,你就到哪里删除。比如你添加账户是在数据库里插入一条记录,那删除就是把这条记录删掉,或者是修改记录中的某个字段,表示这个账户不可用。
qq_37966597 2019-11-03
  • 打赏
  • 举报
回复
如果你是用List去存储的话,可以用remove方法去移除。存在数据库的话,就调用delete的sql语句

62,621

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧