I researched this around and still can't seem to solve this problem. I have the following in my program:
public void InsertDB(double price, double shares, String ticker, int id)throws Exception {
//do some stuff
}
I tried the following within my main class(and got the above error non-static method cannot be referenced in static context):
InsertDB(constants[i], variables[i], ticker[i], count);
Then I read you must create a new instance so I tried(Testingground is the name of my program) and I get an error saying it cannot find the InsertDB symbol:
Testingground myObject = new InsertDB();
I'm new to java and kind of inherited this program(I haven't had this problem with my programs), can someone tell me what I can do to get this to work and the logic behind it?(my insertdb class gives me errors if I turn it to static so that approach won't work). I also read that it might work if I changed public
to protected
but it still didn't work.
Thanks in advance