I am to create a program in Java using multiple methods inside the driver class. Previously, we have only used the main method in such applications.
I know I am to use something like this:
public static void main(String[] args)
{
U4A4 u = new U4A4();
u.run();
}
to run the method public U4A4().
Yes, I know this is terribly basic, but I’ve been searching around all evening and I thought someone here might be able to put it in simple terms how exactly I should do this.
My compiler is getting mad when I try to put in public class U4A4 implements Runnable at the top of my code (it’s right after my imports) and starts wanting me to make it abstract. I have no idea what that is.
So, where do I put implements Runnable and where do I use run()?
Thank you so much for bearing with me here.
Edit: This is what I’ve got so far. http://pastebin.com/J8jzzBvQ
You have implemented
Runnableinterface, but not overriden therunmethod of that interface. I have commented code where you will have to place your thread logic so the thread will work for you.