on 04-20-2007 8:59 AM
I have a method call dumpEnvelope,
if everytime i call the dumpPart , i will call the dumpEnvelope,....
if i call dumpEnvelope , i want to create a new object of inMailBean
how do i do that....
previously, what i do is like this...
InMailBean inMailBean=new InMailBean();
only create 1 instance of object...
i want everytime i call dumpEnvelope((Message)p,out,New OBJECT ->inMailBean(),invalidMailAck)
dumpPart(){
dumpEnvelope((Message)p, out, inMailBean,invalidMailAck);
}
dumpEnvelope(Message m, PrintWriter out, InMailBean inMailBean,InvalidMailAck invalidMailAck){
}
Hi,
If I understood correctly, you want to create new object of InMailBean every time u call dumpEnvelope. If this is correct, then u can do it as follows:
dumpEnvelope((Message)p,out,new InMailBean(), invalidMailAck)
Thanks.
Best Regards,
Shiva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
so create new instance of InMailBean in dumpEnvelop() and return if from that,
cerate new instance with
InMailBean newObj = new InMailBean(); ///just like how you did earlier
return newObj;
so return type of dumpEnvelop() , dumpPart() will be InMailBean, since dumpEnvelop() return this type object to dumpPart() and which in turn return that new obj to calling place. e.g,
InMailBean dumpPart(){}
same for dumpEnvelop()
is that what you were looking for
let me know if it was smthing else
regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.