Ok, so I'm playing with this new concept of "abstract". I made a very simple program that dosen't do much. I have run across an issue, I get a error message when I compile. "cannot resolve symbol" variable c in class french.
public class Test
{
public static void main(String args[])
{
System.out.println("bah");
Donut yum = new French(5);
yum.EatDonut();
}
}
public abstract class Donut
{
int cost;
public Donut(int c)
{
cost = c;
}
public abstract void EatDonut();
}
public class French extends Donut
{
public French(int c)
{
super(c);
}
public void EatDonut()
{
System.out.println("I am eating a French Donut at the cost of" + c);
}
}
public class Test
{
public static void main(String args[])
{
System.out.println("bah");
Donut yum = new French(5);
yum.EatDonut();
}
}
public abstract class Donut
{
int cost;
public Donut(int c)
{
cost = c;
}
public abstract void EatDonut();
}
public class French extends Donut
{
public French(int c)
{
super(c);
}
public void EatDonut()
{
System.out.println("I am eating a French Donut at the cost of" + c);
}
}
