Crow
2013-11-16 08:23:18 UTC
here is the class :
package crow;
public class absclass extends tabungan
{
public absclass(int x,double y, String z)
{
this.acct_no=x;
this.acct_bil=y;
this.nama=z;
}
public void deposit(double amt)
{
acct_bil += amt;
}
public void withdraw(double amt)
{
if( amt <=0 || amt > acct_bil )
{
System.out.println("jumlah yang anda masukkan salah");
}
else
{
acct_bil -= amt;
}
}
}
-----------------------------------------------------------------------------------------------
package crow;
public class deposito extends tabungan
{
public int durasi;
public deposito(int a,double b,String c,int d)
{
this.acct_no=a;
this.acct_bil=b;
this.nama=c;
this.durasi=d;
}
public void deposit(double amt)
{
acct_bil += amt;
}
public void withdraw(double amt)
{
if( amt <=0 || amt > acct_bil )
{
System.out.println("jumlah yang anda masukkan salah");
}
else
{
acct_bil -= amt;
}
}
}
---------------------------------------------------------------------------------------------------------------------
package crow;
public abstract class tabungan
{
public int acct_no;
public double acct_bil;
public String nama;
public abstract void deposit(double amt);
public abstract void withdraw(double amt);
}
the main class is rather long so i put it in pastebin here http://pastebin.com/dnECMWLS
is this error in main code ?