Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This code should be in Java This is to create a new Java project called MyRunnableProject as following. Create a class called MyCurrentDate that implements

This code should be in Java

image text in transcribed

This is to create a new Java project called MyRunnableProject as following. Create a class called MyCurrentDate that implements Runnable interface or extends Thread, you decide which one you need to use? The MyCurrentDate class displays the current date and time x amount of times, with 100 mil interval - use sleep() method for this interval. Create a class called MyMain, which contans main() method, in which 3 instances of MyCurrentDate threads are created and being run. Keep the references to the instances in an array that you can access by index. Each instance of the Thread will be in an infinite loop, running forever so you need to stop each thread. The stop(), kill() and a few other methods are deprecated (no longer allowed). You need to give the number of the thread that you want to stop in your main method. O No for loops, use a while(flag is true) loop. Infinite loop. o Use an instance field Boolean flag to kill just one of the instances at a time by giving the index of the instance in the array

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

1. Describe Kohlbergs three broad stages of moral development.

Answered: 1 week ago