Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.help > #1018
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Newsgroups | comp.lang.java.help |
| Subject | Re: Java class constructor method |
| Date | 2011-09-07 04:51 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <j47b4c$isi$1@dont-email.me> (permalink) |
| References | <91e11576-43b5-4338-9b9d-12462a8548d3@u26g2000yqu.googlegroups.com> <j478qu$6jb$1@dont-email.me> |
On 09/07/2011 04:12 AM, Jeff Higgins wrote:
> 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).
>
Maybe I should say that you are attempting to call an undefined
constructor for the type Television: then the compiler error message
might make more sense.
Back to comp.lang.java.help | Previous | Next — Previous in thread | Next in thread | Find similar
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