Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inheritance not recognized now ......

Status
Not open for further replies.

asiavoices

Programmer
Sep 20, 2001
90
CA
Hello all,

I have a really peculiar problem today in that when I created 4 instances from an abstract class with one abstract method in it, it was working great yesterday....

Now when I revisited it and compiled it again, it gave me the infamous "cannot resolve symbol." message. :-(

I'm basically just creating 4 subclasses (Clubs, Diamonds, Hearts & Spades) from a Card superclass.


The error I'm getting is:

======================================

X:\jdk1.3.1_01\bin>javac Clubs.java
Clubs.java:50: cannot resolve symbol
symbol : class Card
location: class Clubs
public class Clubs extends Card
^
Clubs.java:67: cannot resolve symbol
symbol : variable suitValue
location: class Clubs
return suitValue = "CLUB";
^
2 errors

======================================


Here's my Superclass...

/* -----------------------------------
- Card abstract class -
-----------------------------------*/

public abstract class Card

{
protected int mface;
protected String suitValue;


/** Creates new Card */
public Card()
{
mface = 1;
suitValue = "";
}

public void setFace (int theFace)
{
mface = theFace;
}

public int getFace ()
{
return mface;
}

public abstract String getSuit();

} // end of abstract Card class




/* ---------------------------------------
- One of my subclasses (Clubs) -
---------------------------------------*/


public class Clubs extends Card
{

/* ---- default constructor ----- */

public Clubs()
{
super();
}

/* ---- getSuit returned method ------*/

public String getSuit()
{
return suitValue = "CLUB";
}


} // end of Clubs Class scope


As far as I know, I haven't really changed anything to the best of my knowledge.

Any ideas as to what might be causing this to happen?

Thanks,

Christopher


 
Hello all,

I found out what the problem was and was able to fix it immediately ;-) ...

I don't know how but I took a chance at reseting my classpath and lo and behold, it not compiles..... don't know what happened to have a change in my classpath but its solved at least.

thanks,

Christopher
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top