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


Groups > comp.lang.java.programmer > #33804

Re: ...

From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: ...
Date 2016-02-15 07:52 -0500
Organization A noiseless patient Spider
Message-ID <n9shhp$5qe$1@dont-email.me> (permalink)
References <n9sdug$cej$6@reader1.panix.com>

Show all headers | View raw


On 2/15/2016 6:48 AM, Popping mad wrote:
> can someone tell me exactly what a constructor like this does?
>
>      public Node(Type type, Node... children) {
>          this.type = type;
>          this.children = children;
>      }

     We can infer that the class has fields named `type' and
`children', declared in a manner something like

	/* qualifiers */ Type type;
	/* qualifiers */ Node[] children;

... where /* qualifiers */ may involve things like `private',
`protected', `public', `final', `transient', and so on.  (Maybe
even `static', although that would be unusual.)  The constructor
sets the class' fields equal to its parameters, so after construction
the class' `type' field has the same value as the `type' parameter,
and the `children' field refers to the same array as the `children'
parameter.

     If you're still confused, please describe in more detail just
what you're confused about.

-- 
esosman@comcast-dot-net.invalid
"Don't be afraid of work. Make work afraid of you." -- TLM

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

... Popping mad <rainbow@colition.gov> - 2016-02-15 11:48 +0000
  Re: ... Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-02-15 07:52 -0500
    Re: ... Popping mad <rainbow@colition.gov> - 2016-02-15 13:09 +0000
      Re: ... Eric Douglas <e.d.programmer@gmail.com> - 2016-02-15 05:14 -0800
      Re: ... Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-02-15 08:43 -0500
      Re: ... Andreas Leitgeb <avl@logic.at> - 2016-02-15 13:46 +0000
        Re: ... Eric Douglas <e.d.programmer@gmail.com> - 2016-02-15 06:03 -0800
          Re: ... j4n bur53 <janburse@fastmail.fm> - 2016-02-15 15:54 +0100
            Re: ... Eric Douglas <e.d.programmer@gmail.com> - 2016-02-15 07:24 -0800
              Re: ... Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-02-15 11:08 -0500
                Re: ... Arne Vajhøj <arne@vajhoej.dk> - 2016-02-15 11:17 -0500
                Re: ... Andreas Leitgeb <avl@logic.at> - 2016-02-15 16:34 +0000
                Re: ... Arne Vajhøj <arne@vajhoej.dk> - 2016-02-15 11:43 -0500
                Re: ... Jan Burse <janburse@fastmail.fm> - 2016-02-15 20:44 +0100
                Re: ... Jan Burse <janburse@fastmail.fm> - 2016-02-15 20:44 +0100
                Re: ... Jan Burse <janburse@fastmail.fm> - 2016-02-15 20:45 +0100
                Re: ... Andreas Leitgeb <avl@logic.at> - 2016-02-16 10:05 +0000
                Re: ... Arne Vajhøj <arne@vajhoej.dk> - 2016-02-15 21:46 -0500
      Re: ... Arne Vajhøj <arne@vajhoej.dk> - 2016-02-15 09:34 -0500

csiph-web