Hello, I'm really struggling to understand this homework problem and the concepts behind it:
Write a program called MyQ12Class.java that takes in an integer as an argument, creates that many Threads, and prints out the name of the Threads to the standard output.
Example: "Hi, I am Thread1", "Hi, I am Thread2", and so on and so forth.
Remember to covert the element in args[0] into an Integer, using the valueOf() method.
Remember that if the valueOf method fails it can throw Exceptions, so you will need a try/catch block.
Override the run method to print the
Thread name to the standard output. The teacher provided me some help with this code, but I'm not understanding the concepts behind it:
I guess my main questions are:
What type of exceptions are appropriate?
How to instantiate the threads?
Any help would be greatly appreciated!