Java compiling error, please help, i suck at java -
here error : "exception in thread "main" java.lang.runtimeexception: uncompilable source code - constructor thecontroller in class project**.thecontroller cannot applied given types;
required: java.lang.string
found: int
reason: actual argument int cannot converted java.lang.string method invocation conversion @ project***.main.main(main.java:23)"
i know tells me problem is, how fix it?
here code "main",
public class main { /** * @param args command line arguments */ public static void main(string[] args) throws ioexception { readfile statesreadfile = new readfile(); statesreadfile.loaddata("states2.txt"); thecontroller statesqueues = new thecontroller(statesreadfile.getnumstates()); statesstack mystatesstack = new statesstack(statesreadfile.getnumstates());
and here guess doesn't match cause have error there too,
public class thecontroller { public queues pq1; public queues pq3; public queues pq5; public queues pq6; private statesstack statearray; private readfile statesreadfile; /* * */ public thecontroller(string filename) throws ioexception { statesreadfile = new readfile(); statearray = statesreadfile.loaddata(filename); pq1 = new queues(6); pq3 = new queues(12); pq5 = new queues(6); pq6 = new queues(12); }// end of
any helpful suggestion appreciated, .
(oh , have more code if needed)
the parameter passing thecontroller
constructor int should string in line thecontroller statesqueues = new thecontroller(statesreadfile.getnumstates());
getnumstates()
returns number of states.
Comments
Post a Comment