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


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

Re: Java class constructor method

From Jeff Higgins <jeff@invalid.invalid>
Newsgroups comp.lang.java.help
Subject Re: Java class constructor method
Date 2011-09-07 04:12 -0400
Organization A noiseless patient Spider
Message-ID <j478qu$6jb$1@dont-email.me> (permalink)
References <91e11576-43b5-4338-9b9d-12462a8548d3@u26g2000yqu.googlegroups.com>

Show all headers | 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