As you may have guessed from me posting here I am new to java game programming.( I usually spend most of my time making Operation Flashpoint missions).
Anyway to the problem. I'm after making a threadpool using David Brackeens acclaimed book. However when I compile the .java file it says that the system.out.printIn has an unrecognised symbol and the "." symol is highlighted.
Here's what the console printed out.
1 2 3 4
| ThreadPooltest.java:40 cannot resolve symbol symbol : method printIn (java.lang.String) location: class java.io.PrintStream System.out.printIn("Task " + taskID + ": start"); |
If anybody can help it would be much appreciated.
Oh and here's the actual threadpooltest code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
| public class ThreadPoolTest {
public static void main(String[] args) { if (args.length != 2) { System.out.printIn("Tests the ThreadPool task."); System.out.printIn( "Usage: java ThreadPoolTest numTasks numThreads"); System.out.printIn( " numTasks - integer: number of tasks to run."); System.out.printIn( " numThreads - integer: number of threads " + "in the thread pool."); return;
} int numTasks = Integer.parseInt(args[0]); int numThreads = Integer.parseInt(args[1]);
ThreadPool ThreadPool = new ThreadPool (numThreads);
for (int i=0; i<numTasks; i++) { ThreadPool.runTask(createTask(i)); }
ThreadPool.join(); }
private static Runnable createTask(final int taskID) { return new Runnable() { public void run() { System.out.printIn("Task " + taskID + ": start");
try { Thread.sleep(500); } catch (InterruptedException ex) {}
System.out.printIn("Task " + taskID + ": end"); } }; } } |
Thanks,
Hauk