Question: Hello, so I need someone to look over this code and see if im on the right path. I feel like im missing something. Here
Hello,
so I need someone to look over this code and see if im on the right path. I feel like im
missing something.
Here is the assignment:
Create a class called Slogans. This class will extend the Thread class. This thread will read from a file several quotes that are on each line. It will pick a quote randomly and display it to the console. It will change quotes every 7 seconds. This will be updated in the final project to display in a GUI.
Here are the quotes I need to display:
May the force be with you
Don't cross the streams
Live long and prosper
I'll be back
Strength and honor
Yo, Adrian
Autobots, transform and roll out
Hulk Smash!
With great power comes great responsibility
There is only one thing we say to death: not today
Here is the code:
I started off with this:
public class Main implements Runnable {
String msg;
Main(String s)
{
msg=s;
}
public static void main(String[] args) {
Thread t1 = new Thread(new Main("m"));
Thread t2 = new Thread(new Main("n"));
t1.start();
t2.start();
}
public void main(String[] args){
}
I'm sorry the language is for Java.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
