basgen
asked on
exception in thread 2
is there something Im missing here to get excption in thread? these 2 programs have the same prob..
prog1:import java.util.*;
public class AuditedCard extends CreditCard implements CardInterface {
protected Vector transacts; // to keep transactions
private String num;
private String name;
private String bank;
private double balance;
private int limit;
private String type;
private double amount;
ArrayList transList;
public AuditedCard(String numb1, String name1, String bank1, double balance1, int limit1) {
super (numb1,name1,bank1,balance 1,limit1);
num = numb1;
name = name1;
bank = bank1;
balance = balance1;
limit = limit1;
transList = new ArrayList();
}
public boolean chargeIt(double price) { // Make a charge
if (price + balance > (double) limit)
return false; // Not enough money left to charge it
balance += price;
return true; // The charge is accepted
}
public void recordTrans(String ty, double amt){
}
public double getBalance(){
return balance;
}
public void print(){
//printing all e results
}
}
prog 2:public interface CardInterface {
// Accessor methods
public String getNumber();
public String getName();
public String getBank();
public double getBalance();
public int getLimit();
// Action methods
public boolean chargeIt(double price);
public void makePayment(double payment);
public void print();
}
prog1:import java.util.*;
public class AuditedCard extends CreditCard implements CardInterface {
protected Vector transacts; // to keep transactions
private String num;
private String name;
private String bank;
private double balance;
private int limit;
private String type;
private double amount;
ArrayList transList;
public AuditedCard(String numb1, String name1, String bank1, double balance1, int limit1) {
super (numb1,name1,bank1,balance
num = numb1;
name = name1;
bank = bank1;
balance = balance1;
limit = limit1;
transList = new ArrayList();
}
public boolean chargeIt(double price) { // Make a charge
if (price + balance > (double) limit)
return false; // Not enough money left to charge it
balance += price;
return true; // The charge is accepted
}
public void recordTrans(String ty, double amt){
}
public double getBalance(){
return balance;
}
public void print(){
//printing all e results
}
}
prog 2:public interface CardInterface {
// Accessor methods
public String getNumber();
public String getName();
public String getBank();
public double getBalance();
public int getLimit();
// Action methods
public boolean chargeIt(double price);
public void makePayment(double payment);
public void print();
}
I think this is a similar question to a previous one, please post here if you also think so: https://www.experts-exchange.com/questions/21890971/exception-in-thread.html
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Pls delete duplicate Q's instead of accepting.