Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #13956
| From | markspace <-@.> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: beginning java...nublet drowning. throw me a lifeline? |
| Date | 2012-04-27 20:28 -0700 |
| Organization | A noiseless patient Spider |
| Message-ID | <jnfo4f$7fu$1@dont-email.me> (permalink) |
| References | <89baf7bb-7b1d-4bc0-80ba-a4881de09810@t16g2000yqt.googlegroups.com> |
On 4/27/2012 4:20 PM, Justin Fondriest wrote:
>
> Ok...so is this saying "a car has an engine", with regard to code
> would be more like "a car (class)"--as in every car class--"has an
> engine(object)"?
This is more or less correct. Don't forget that the engine is also a
class, and not an object, until you instantiate the Car, then you have
both a Car object and an Engine object;
class Car {
Engine engine = new Engine();
}
There's no objects in the above code until someone calls "new Car()".
>
>
> Now whether I am right or wrong...could someone take maybe 3 minutes
> to explain what composition is in layman's terms?
You were pretty close.
>
> does it have anything to do with the "import" feature that you put in
> a program before you "instantiate"(?) the class?
Nope, not a darn thing.
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
beginning java...nublet drowning. throw me a lifeline? Justin Fondriest <jfondriest82@gmail.com> - 2012-04-27 16:20 -0700
Re: beginning java...nublet drowning. throw me a lifeline? Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-04-27 21:48 -0400
Re: beginning java...nublet drowning. throw me a lifeline? markspace <-@.> - 2012-04-27 20:28 -0700
Re: beginning java...nublet drowning. throw me a lifeline? Lew <noone@lewscanon.com> - 2012-04-28 12:42 -0700
Re: beginning java...nublet drowning. throw me a lifeline? Roedy Green <see_website@mindprod.com.invalid> - 2012-04-27 20:48 -0700
Re: beginning java...nublet drowning. throw me a lifeline? Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-04-28 11:56 -0300
csiph-web