Computer problems,Computer help
*AX SOFT>>>Programming & Design

Inheritance and polymorphism help pleaseeeeee!!!!!!!!!?


hi fellas, I have a problem trying to create an array of 40 elements with mixed objects (I'm desinging a monopoly game).

BoardPiece [] pieces = new BoardPiece [40];

I have 4 classes: Property, Utility Railroad which all have a header like this "extends BoardPiece". BoardPiece is my general class.

so when writing this :

BoardPiece [] pieces = new BoardPiece [40];
pieces[counter] = new Property(name, type, price, rent ,color);

ERROR: it says The Constructor property is undefined????????

help would be apreciate it

im doing this in JAVA

I don't think this is an inheritance problem I think the problem is in your constructor definition.

I can't tell for sure without seeing your code but you most-likely passing your parameters in a different order than your constructor is defined.

Tags
  General - Computers & Internet   Software   Security   Programming & Design   Facebook   Flickr   Google   MSN   MySpace
Related information
  • How do i change the text color of the letters inside a table (HTML)?

    Hi there, Add style to your <td> tag... <td style="color: #FF0000;"> Or you can put the text in between div tags... <td> <div style="color: #FF0000;...

  • Arrange the following in descending order?

    each letter represents 4 bits. So any number that begins with 8-F is negative You can convert the numbers like so hex binary 8 1000 9 1001 A 1010 B 1011 ...

  • Can <tr> rows be styled or do you have to style seperate <td> cells?

    Yes, table rows, can be styled, but you can;t just specify any type of style. Then again, this is true for all HTML elements. I know you can specify a background for a table row, but not a borde...

  • Autorun function?

    All you need to do is put an autorun.inf file in the root. Check the source. Note that autorun is a request, not a demand. Users may have their computer set up to disregard autoruns.

    ...
  • Here in Javascript version. Anyone can change it to vbscript?

    vbscript isn't really a good choice as it is server side while javascript is client side. You would need a big rework of this and turn it into a form. So you'd end up with a clunky for...

  • How do I make fractions on the?

    Go to insert, object (make sure create new) tab is clicked, then scroll down to microsoft equation. if it's not there, then u might have to install that part off of the cd

    ...
  • Computers....?

    go to start then contol panel. select internet options , now a second screen will appear look all the way down to the bottom one and select delete all "web Browseing history pass-word etc.&quo...

  • Images on my website can only be viewed in Safari.....why!?

    I'll assume that you actually did upload the image file as well as the HTML, since you're following the tutorial. Check the HTML code for errors. Does your image tag look like this? .....

  •  

    Categories--Copyright/IP Policy--Contact Webmaster