I have written two different classes that are in two different files one is LoadData.java and the other is csvReader.java both are in the same folder. In the class LoadData I try to use a public function in csvReader by calling csvReader.getData(), when I compile LoadData, which is after I have compiled csvReader, LoadData gives me the following:

LoadData.java:63: cannot find symbol
symbol : variable csvReader
location: class LoadData

Why is this happening? This program compilied fine and ran on another computer. Can I included the class csvReader in LoadData?

I'm reasonably new to Java as well, but I think you've forgotten to do this?

csvReader myReader = new csvReader();
myReader.getData();

That first line depends on what constructor(s) you're using in csvReader. I've used the default constructor in my example.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.