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


Groups > comp.lang.java.help > #1017

Re: Java class constructor method

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 <jeff@invalid.invalid>
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 <j478qu$6jb$1@dont-email.me> (permalink)
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

Show key headers only | View raw


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).

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


Thread

Java class constructor method Cleaver Greene <thybutcher@gmail.com> - 2011-09-06 23:33 -0700
  Re: Java class constructor method Jeff Higgins <jeff@invalid.invalid> - 2011-09-07 04:12 -0400
    Re: Java class constructor method Jeff Higgins <jeff@invalid.invalid> - 2011-09-07 04:51 -0400
      Re: Java class constructor method Lew <lewbloch@gmail.com> - 2011-09-07 08:11 -0700

csiph-web