Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Jeff Higgins Newsgroups: comp.lang.java.help Subject: Re: Java class constructor method Date: Wed, 07 Sep 2011 04:12:31 -0400 Organization: A noiseless patient Spider Lines: 22 Message-ID: References: <91e11576-43b5-4338-9b9d-12462a8548d3@u26g2000yqu.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 7 Sep 2011 08:09:02 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="Z+UYWCPnTu4kxHsUACWmFQ"; logging-data="6763"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18GtgxedwERu+k6wMTEqffXrZlCRMWypqI=" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20110818 Icedove/3.0.11 In-Reply-To: <91e11576-43b5-4338-9b9d-12462a8548d3@u26g2000yqu.googlegroups.com> Cancel-Lock: sha1:jCMSG+43VoAyXzAmulTCI74+VGQ= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.help:1017 On 09/07/2011 02:33 AM, Cleaver Greene wrote: > Why doesn't this line compile? > Television bigScreen = new Television("Toshiba", 55); > public class Television > { > public int SCREEN_SIZE; > char MANUFACTURER; > > public Television(char tvMANUFACTURER, int tvSCREEN_SIZE) > { > MANUFACTURER = tvMANUFACTURER; > SCREEN_SIZE = tvSCREEN_SIZE; > } You have declared the formal parameters of the sole constructor of a Television object to be of type (char, int). The actual parameters you attempt to use in a call to this constructor are of type (String, int).