?
Solved

exception in thread 2

Posted on 2006-06-19
3
Medium Priority
?
249 Views
Last Modified: 2010-03-31
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,balance1,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();
}

0
Comment
Question by:basgen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 16933390
I think this is a similar question to a previous one, please post here if you also think so: http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_21890971.html
0
 
LVL 30

Accepted Solution

by:
Mayank S earned 2000 total points
ID: 16933567
Yes, its perhaps a duplicate.
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 16941162
Pls delete duplicate Q's instead of accepting.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question