The Artima Developer Community
Sponsored Link

Java Answers Forum
inheritence

1 reply on 1 page. Most recent reply: Jun 4, 2002 5:44 PM by Singh M.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
jake

Posts: 83
Nickname: onorok
Registered: May, 2002

inheritence Posted: Jun 4, 2002 5:32 PM
Reply to this message Reply
Advertisement
This is the error:

--------------------Configuration: JDK version 1.3 <Default>------------------------------------------------
C:\Program Files\Xinox Software\JCreator\MyProjects\BlackJack Game\Blackjack.java:15: cannot resolve symbol
symbol : constructor Hand (DeckOfCards)
location: class Hand
super(d);
^
1 error

And this is the code:

public class Blackjack extends Hand
{
//--------------------------------------------------------------------
//Holds the score keeping class for the BlackJack game
//--------------------------------------------------------------------
public Blackjack(DeckOfCards d)
{
super(d);
}

public int score()
{
int scoretotal=0;
int face=10;
int ace=11;
for(int count=0;count<Handofcards.size();count++)
{
Card temp=(Card)Handofcards.elementAt(count);
if(temp.value==10)
{
scoretotal+=face;
}
else if(temp.value==1)
{
scoretotal+=ace;
}
else
scoretotal+=temp.value;
}
return scoretotal;
}

public boolean isBusted()
{
if(score()>21)
return true;
else
return false;
}
}

can anyone help me???


Singh M.

Posts: 154
Nickname: ms
Registered: Mar, 2002

Re: inheritence Posted: Jun 4, 2002 5:44 PM
Reply to this message Reply
In your class Hand you do not have a constructor which takes DeckOfCards as an argument.

Flat View: This topic has 1 reply on 1 page
Topic: Using JavaScript Variable in JSP Scriptlet Previous Topic   Next Topic Topic: How to Create an Executable File

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use