Solved

exception in thread 2

Posted on 2006-06-19
3
209 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
  • 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:
mayankeagle earned 500 total points
ID: 16933567
Yes, its perhaps a duplicate.
0
 
LVL 30

Expert Comment

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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
factorial example challenge 10 62
allStar challenge 1 41
Checkbox and ListView in Android Layout 4 39
Java DateChooser? 2 11
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
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…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now