这个程序有问题.但是改不来
个位大哥大街们帮忙看下
import java.io.*;
import java.util.*;
public class Bank
{ static int i;
public static void main(String argsp[])
{
Thread t=new Thread();
Cun c=new Cun(Cun c);
Qu q=new Qu(Qu q);
new Thread(c).start();
new Thread(q).start();
}
}
class Cun extends Bank
implements Runnable
{ Cun c;
public void Cun(Cun c)
{
this.c=c;
}
public void run()
{
try
{System.out.println("请输入你要存的数目:");
BufferedReader in=new BufferedReader
(new InputStreamReader(System.in));
i=Integer.parseInt(in.readLine());
c.A();
}
catch(Exception e){};
}
public static void A()
{
super.i=i;
System.out.println("您存了"+i+"元");
}
}
class Qu extends Bank
implements Runnable
{ private static int n;;//取钱的数目
Qu q;
public Qu(Qu q)
{
this.q=q;
}
public void run()
{
System.out.println("拧的剩额为:"+i);
System.out.println("请输入你要取的数目:");
try
{
BufferedReader in=new BufferedReader
(new InputStreamReader(System.in));
n=Integer.parseInt(in.readLine());
}
catch(Exception e){};
System.out.println("取走:"+n+"元");
System.out.println("拧的剩额为:"+q.Yuan());
}
public static int Yuan()
{
return i-n;
}
}