final pt.

one more thing guys.....i managed to come out with this for transaction.java...no sure with the condition part....wld appreciate the knowledge in that...many thanks.
public class Transaction {

  private String recordTrans ;
  private String accountNumber1 ;
  private String accountNumber2 ;
  private double amt ;
  private Calendar date ;
  private String type ;

     Calendar date;
     private Object rec;
     
     public Transaction(){
     
     }
     
     public addRecord(String type, double amt){
                   
I AM STUCK HERE!!!!
         
          recordTrans = date.getDate() + " " + transType + " " + amount;          
          date.tock(7);
          return recrecordTrans;
     }
}
basgenAsked:
Who is Participating?
 
objectsCommented:
first add setters and getter to your class

public class Transaction {

  private String recordTrans ;
  private String accountNumber1 ;
  private String accountNumber2 ;
  private double amt ;
  private Calendar date ;
  private String type ;

     Calendar date;
     private Object rec;
     
     public Transaction(){
     
     }

     public void setType(String type) {
        this.type = type;
     }

     public String getType() {
        return type;    
    }

     // do the same for the other member variables
}

The to create a Transaction use:

Transaction tx = new Transaction();
tx.setType("xxx");
tx.setDate(Calendar.getInstance());
// set other properties as required

You can then add the create Transaction object where needed
0
 
CEHJCommented:
Your addRecord is in the wrong class. It should be in a class owning a collection of Transaction, not in Transaction itself
0
 
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
Can you be more clear by what you meant by " I AM STUCK HERE!!!!  ". what exactly are you trying to do?
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

 
basgenAuthor Commented:
but i still dont understand though...
Transaction tx = new Transaction();
tx.setType("xxx");
tx.setDate(Calendar.getInstance());
// set other properties as required

You can then add the create Transaction object where needed


do i add this bit in the prog...it wont make sense then right..
 pls advise...
0
 
CEHJCommented:
If you're not sure if that answers your question, then why have you accepted an answer?

The answer accepted doesn't particuarly seem to me to tally with your specific comment

>>I AM STUCK HERE!!!!

either ...
0
 
objectsCommented:
> do i add this bit in the prog...it wont make sense then right..

yes you do it in the program or method where u want to create your transaction objects
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.