Path: csiph.com!usenet.pasdenom.info!news.albasani.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: markspace <-@.> Newsgroups: comp.lang.java.programmer Subject: Re: beginning java...nublet drowning. throw me a lifeline? Date: Fri, 27 Apr 2012 20:28:11 -0700 Organization: A noiseless patient Spider Lines: 29 Message-ID: References: <89baf7bb-7b1d-4bc0-80ba-a4881de09810@t16g2000yqt.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 28 Apr 2012 03:28:15 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="Nhfo9ulyZqrLDUaAyycsPw"; logging-data="7678"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/mHYPBqYoWCifgR4VVmwF4QWEjwYC57wY=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 In-Reply-To: <89baf7bb-7b1d-4bc0-80ba-a4881de09810@t16g2000yqt.googlegroups.com> Cancel-Lock: sha1:aA7laf8Hmj6Zi/u4E0hacsvMTN4= Xref: csiph.com comp.lang.java.programmer:13956 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.