Solved

exception in thread 2

Posted on 2006-06-19
3
230 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:
Mayank S earned 500 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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)
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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 will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

828 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