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


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

Re: A question about a few variables in a class

From Lew <lewbloch@gmail.com>
Newsgroups comp.lang.java.programmer
Subject Re: A question about a few variables in a class
Date 2011-08-14 22:50 -0700
Organization http://groups.google.com
Message-ID <3a0ee39c-2d66-4413-a0ba-7a3cb54b6fd7@glegroupsg2000goo.googlegroups.com> (permalink)
References (1 earlier) <j1ja73$g9q$1@dont-email.me> <8ff5e4fa-84c5-4d4a-97e8-0b2f3f5b0dc4@m5g2000prh.googlegroups.com> <j2762o$mlf$1@dont-email.me> <9b372a01-59c9-462a-a5ca-463f3ededb9d@y19g2000pre.googlegroups.com> <j29civ$1pe$1@dont-email.me>

Show all headers | View raw


markspace wrote:
> Chad wrote:
>>    public Rectangle1(double width, double height, String color,
>>        boolean filled) {
> 
> Method parameters.

Constructor parameters, not method parameters.

>>      this.width = width;
>>      this.height = height;
> 
> Instance fields on the left of the assignment.  (Note "data fields" 
> isn't used in any Java documentation I can recall.)

Also called instance attributes, although that term is more apt for the methods that cover them, or for public instance fields.

Another name is instance member fields.

>>      setColor(oolor);
>>      setFilled(filled);
> 
> Method invocation, in the super class these methods set more instance 
> fields.

Note that the use of non-final member methods in a constructor of the same class is dangerous.

-- 
Lew

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


Thread

A question about a few variables in a class Chad <cdalten@gmail.com> - 2011-08-05 14:31 -0700
  Re: A question about a few variables in a class markspace <-@.> - 2011-08-05 14:46 -0700
  Re: A question about a few variables in a class Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-08-06 07:56 -0400
    Re: A question about a few variables in a class Chad <cdalten@gmail.com> - 2011-08-13 10:30 -0700
      Re: A question about a few variables in a class Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-08-13 20:49 -0400
        Re: A question about a few variables in a class Chad <cdalten@gmail.com> - 2011-08-14 13:23 -0700
          Re: A question about a few variables in a class markspace <-@.> - 2011-08-14 13:52 -0700
            Re: A question about a few variables in a class Lew <lewbloch@gmail.com> - 2011-08-14 22:50 -0700
          Re: A question about a few variables in a class Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-08-14 18:04 -0400
            Re: A question about a few variables in a class Chad <cdalten@gmail.com> - 2011-08-14 17:09 -0700
              Re: A question about a few variables in a class Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-08-14 21:57 -0400
              Re: A question about a few variables in a class Lew <lewbloch@gmail.com> - 2011-08-14 22:55 -0700
          Re: A question about a few variables in a class Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-08-14 18:01 -0400
  Re: A question about a few variables in a class Roedy Green <see_website@mindprod.com.invalid> - 2011-08-06 22:58 -0700
    Re: A question about a few variables in a class Patricia Shanahan <pats@acm.org> - 2011-08-07 05:28 -0700
  Re: A question about a few variables in a class Lew <lewbloch@gmail.com> - 2011-08-10 09:14 -0700
    Re: A question about a few variables in a class Chad <cdalten@gmail.com> - 2011-08-13 10:27 -0700
  Re: A question about a few variables in a class Patricia Shanahan <pats@acm.org> - 2011-08-14 18:36 -0700

csiph-web