Java语言的代码

1个回答
展开全部
摘要 您好,Java是一种面向对象编程语言,它用于构建安全、可靠的应用程序。它的语法类似于C和C++,但具有更少的代码和更强大的站点功能。
咨询记录 · 回答于2023-01-03
Java语言的代码
您好,Java是一种面向对象编程语言,它用于构建安全、可靠的应用程序。它的语法类似于C和C++,但具有更少的代码和更强大的站点功能。
这个答案
public class Account{ private String id; private String password; private double balance; public void setId(String id){ this.id=id; } public String getId(){ return this.id; } public void setPassword(String password){ this.password=password; } public String getPassword(){ return this.password; } public void setBalance(double balance){ this.balance=balance; } public double balance(){ return this.balance; } public void deposit(double money){
这个对的吧
是的
最好的大括号就一个吗?
最后的
public class Account{ private String id; private String password; private double balance; public void setId(String id){ this.id=id; } public String getId(){ return this.id; } public void setPassword(String password){ this.password=password; } public String getPassword(){ return this.password; } public void setBalance(double balance){ this.balance=balance; } public double balance(){ return this.balance; } public void deposit(double money){
this.balance-=money; } }}
this.balance+=money; } public void withdraw(double money){ if(this.balance>=money){ this.balance-=money; }
后面还有个这个
}}
后面还有两个这个
这个输入法不太好
我给您重新整合一下吧
public class Account{ private String id; private String password; private double balance; public void setId(String id){ this.id=id; } public String getId(){ return this.id; } public void setPassword(String password){ this.password=password; }public String getPassword(){ return this.password; } public void setBalance(double balance){ this.balance=balance; } public double balance(){ return this.balance; } public void deposit(double money){
public class Account{ private String id; private String password; private double balance; public void setId(String id){ this.id=id; } public String getId(){ return this.id; } public void setPassword(String password){ this.password=password; }
public String getPassword(){ return this.password; } public void setBalance(double balance){ this.balance=balance; } public double balance(){ return this.balance; } public void deposit(double money){ this.balance+=money; } public void withdraw(double money){ if(this.balance>=money){ this.balance-=money; } }}
好吧,我知道了,他这里面有字数限制
我还以为都发过去了
我只能分开给您发过去啦
下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消