开发者

Xcode cannot find a java class which I'm trying to extend

I'm working on a Java project which was written by someone else. This person made a hierarchy of folders insi开发者_Python百科de the 'src' folder. I've added a new java class into one of those folders and defined it as 'XmlFile.java'. Then, I'm trying to have it extend a previously written class 'GenericFile.java' by writing

package //Same package GenericFile is in

public class XmlFile extends GenericFile
{
...
}

When I try to compile the project it gives me the error

Cannot find symbol

and refers me to the line

public class XmlFile extends GenericFile

if I take out

extends GenericFile

everything compiles great.

I also notice after adding the new file (XmlFile.java) I cannot delete it (the option in Edit->Delete is not selectable for that file, or for any files/folders created by the person from whom I got the project).

Is there some sort of permission issue here or some hidden scope issue caused by the permissions being strange or what?

Please help me

Cheers, WhiteTiger


I admit I am not an expert enough to figure out "Cannot find symbol" from a Java compiler, but since there is no other answer, here is a sneaky idea -

If GenericFile is a working and useful abstract class, there has to be at least one other class (hopefully working) that extends it. Since you have the source code, find out one such file, copy it to XmlFile.java, edit it to change the constructor name to XmlFile and try to compile it. If it compiles, start from there. If not, you will know where the problem lies.

Just trying to help! Good luck, - M.S.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜