Solved

exception in thread 2

Posted on 2006-06-19
3
238 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 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jboss 7.1 start up error 1 85
JAVA API design with micro service cloud in mind 1 115
DTD and JAVA versions 1 59
Strange router problem - can't access hotmail.com 14 109
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

752 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