Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #638

Re: Why can one invoke setters and getters from a (class) constructor?

From Roedy Green <see_website@mindprod.com.invalid>
Newsgroups comp.lang.java.help
Subject Re: Why can one invoke setters and getters from a (class) constructor?
Date 2011-04-24 06:53 -0700
Organization Canadian Mind Products
Message-ID <0na8r6tg38fu60ojepfl5h4u20lmhfhffr@4ax.com> (permalink)
References <87bozwkgz8.fsf@merciadriluca-station.MERCIADRILUCA>

Show all headers | View raw


On Sat, 23 Apr 2011 19:36:11 +0200, Merciadri Luca
<Luca.Merciadri@student.ulg.ac.be> wrote, quoted or indirectly quoted
someone who said :

>r. Setters and getters are defined over the object whose
>type is defined by the class. But the object is only defined once the
>constructor has been parsed totally, isn't it?

No.  Like a human, a object gradually comes into being.
see http://mindprod.com/jgloss/initialisation.html
http://mindprod.com/jgloss/constructor.html

Java lets you hang yourself by operating on partially born objects.
It has to, otherwise, how would fields get initialised? Everything is
determinate however, just not necessarily what you wanted.
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
Politicians complain that Kindles and iBooks are killing jobs by 
destroying the paper book industry.  I see it that they have create a way 
to produce books for less than a third the cost without destroying forests 
and emitting greenhouse gases in the process.  They have created wealth.  
They are encouraging literacy and cutting the costs of education.  

Back to comp.lang.java.help | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Why can one invoke setters and getters from a (class) constructor? Merciadri Luca <Luca.Merciadri@student.ulg.ac.be> - 2011-04-23 19:36 +0200
  Re: Why can one invoke setters and getters from a (class) constructor? Lew <noone@lewscanon.com> - 2011-04-23 13:58 -0400
  Re: Why can one invoke setters and getters from a (class) constructor? markspace <-@.> - 2011-04-23 11:00 -0700
    Re: Why can one invoke setters and getters from a (class) constructor? Merciadri Luca <Luca.Merciadri@student.ulg.ac.be> - 2011-04-23 23:53 +0200
  Re: Why can one invoke setters and getters from a (class) constructor? Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-04-23 20:36 -0400
    Re: Why can one invoke setters and getters from a (class) constructor? Lew <noone@lewscanon.com> - 2011-04-23 22:37 -0400
  Re: Why can one invoke setters and getters from a (class) constructor? Roedy Green <see_website@mindprod.com.invalid> - 2011-04-24 06:53 -0700
    Re: Why can one invoke setters and getters from a (class) constructor? Fred <fred.l.kleinschmidt@boeing.com> - 2011-04-25 11:06 -0700
      Re: Why can one invoke setters and getters from a (class) constructor? Lew <noone@lewscanon.com> - 2011-04-25 15:14 -0400

csiph-web