java - inheritence class not compiling -
i playing around code , learned inheritance in class today, cant compile , dont know wrong, says can not find c in line colorfeathers = c
public class bird extends inheritance{ private string colorfeathers; public bird(string c, string n){ super("bird:" , n, 2, 0); colorfeathers = c; } public string getcolor(){return colorfeathers;} public void setcolors(){colorfeathers = c;} public string tostring(){ string hold = super.tostring(); hold += "color:" + colorfeathers; return hold; } }
the problem in public void setcolors(){colorfeathers = c;} not passing in c string variable unknown in context of setcolors method
Comments
Post a Comment