会JAVA的网友,帮我看看我的程序怎么错了,我新手。
会JAVA的网友,帮我看看我的程序怎么错了,我新手。Java错误显示需要class,ifterface或者enumimporjava.io.*;publicclassDe...
会JAVA的网友,帮我看看我的程序怎么错了,我新手。Java错误显示需要class,ifterface或者enum
impor java.io.*;
public class Depositor
{
String name;
String identify;
String accountnumber;
int balance=0;
public void storage()
{
InputStreamReader ir;
BufferedReader in;
ir=new InputStreamReader(System.in);
in=new BufferedReader(ir);
System.out.println("储存金额:");
String a=in.readLine();
int b=Integer.parseInt(a);
balance+=b;
}
String drawout();
{
InputStreamReader ir;
BufferedReader in;
ir=new InputStreamReader(System.in);
in=new BufferedReader(ir);
System.out.println("取出金额:");
String c=in.readLine();
int d=Integer.parseInt(c);
if(d<=balance)
{
balance-=d;
String e=String.valueOf(balance);
System.out.println("余额:");
return e;
}
else
return "余额不足";
}
public static void main(String[] args)
{
Depositor p1=new Depositor();
String f=p1.drawout();
System.out.println(f);
}
} 展开
impor java.io.*;
public class Depositor
{
String name;
String identify;
String accountnumber;
int balance=0;
public void storage()
{
InputStreamReader ir;
BufferedReader in;
ir=new InputStreamReader(System.in);
in=new BufferedReader(ir);
System.out.println("储存金额:");
String a=in.readLine();
int b=Integer.parseInt(a);
balance+=b;
}
String drawout();
{
InputStreamReader ir;
BufferedReader in;
ir=new InputStreamReader(System.in);
in=new BufferedReader(ir);
System.out.println("取出金额:");
String c=in.readLine();
int d=Integer.parseInt(c);
if(d<=balance)
{
balance-=d;
String e=String.valueOf(balance);
System.out.println("余额:");
return e;
}
else
return "余额不足";
}
public static void main(String[] args)
{
Depositor p1=new Depositor();
String f=p1.drawout();
System.out.println(f);
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询