I am little puzzled. Let me clear my understanding.
When I say
Node cld = list.item(i).getFirstChild();
am I calling any constructor of the object, if yes which one?
Do we have any kind of copy constructor like C++. If we do then what
is the syntex of that constructor and how does it internally invoked.
Thanks,
-ShriKant
Komaravolu Vasudha wrote:
hello srikanth,
second one is more efficient as in the first case the node cld will
be creating each and every time. So if the count value is larger then that
many times this object will be created.-----Original Message-----
From: ShriKant Vashishtha [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 18, 2001 1:42 PM
To: [EMAIL PROTECTED]
Subject: Re: Urgent !!!!!!!! Please help meHi All,
1. for (int i = 0; i < count; i++) {
Node cld = list.item(i).getFirstChild();
}2. Node cld = null;
for (int i = 0; i < count; i++) {
cld = list.item(i).getFirstChild();
}Which one is more efficient between the two and why.
Thanks,
-ShriKant"Gare, Trefor" wrote:
> Not quite sure what you're after but the second will allow the JVM to use
a
> single String object for multiple references (if there are any other
strings
> "Tendulkar"). The first will always create a new String object. In that
> way the second is a more economical way of creating/referencing the
object.
> Is that a help?
>
> Tref Gare
> Web Developer MCSD
> eCommerce Group
> Phone: (03) 9221 4106
> Mobile: 0409 556 478
> Fax: (03) 9941 4295
>
> > -----Original Message-----
> > From: Ravindra [SMTP:[EMAIL PROTECTED]]
> > Sent: Tuesday,18 December 2001 5:24
> > To: [EMAIL PROTECTED]
> > Subject: Re: Urgent !!!!!!!! Please help me
> >
> > Hi All,
> >
> > String string_Name = new String("Tendulkar");
> >
> > String string_Name = "Tendulkar";
> >
> > In Above two statements which is compatible(Speed,Instantiating and
other
> > parameters.) for java compiler.
> >
> > thanks
> >
> > Varna.
> >
> >
==========================================================================
> > =
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> > JSP-INTEREST".
> > For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> > DIGEST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> > http://archives.java.sun.com/jsp-interest.html
> > http://java.sun.com/products/jsp/faq.html
> > http://www.esperanto.org.nz/jsp/jspfaq.jsp
> > http://www.jguru.com/faq/index.jsp
> > http://www.jspinsider.com
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://archives.java.sun.com/jsp-interest.html
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.jsp
> http://www.jguru.com/faq/index.jsp
> http://www.jspinsider.com===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:http://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:http://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com