Forgive me if im doing this wrong my first time using a forum.
Ok my question is if i create a method in a seperate class file from the one with the main method to create a new thread can i make a way that when i call it in my main method that i just enter what i want it to do in a String or something and it creates the thread and does whats in the String!
Thanks in advance!!!
No, not in pure java. That is dynamic behavior and would require some kind of dynamic code evaluation. The Groovy language (java based) supports exactly this. You can write any arbitrary code in a text file, open the file with your app, and execute the code in the file, all at runtime. To do this in java, you need to use a rather complex combination of interfaces and a domain specific language you make up yourself. Java is not the best language for doing this kind of thing (it's a lot of work) but it can be (and has been) done.
If you're a fan of java, need to use the JVM, but also really need dynamic behavior, take a look at groovy. It'll work with your existing java code, but has a lot of other cool tricks too!
Thank you for the help and i will look into groovy!