From the course: Java Threads

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Solution: Webinar polling system

Solution: Webinar polling system - Java Tutorial

From the course: Java Threads

Solution: Webinar polling system

(upbeat music) - [Instructor] Now I'll walk you through, step by step, how to solve the challenge. First, I've implemented the VotingRunnable class by the Runnable interface. By doing this, I'm making this class capable of implementing the running behavior that can be executed by a voting thread. To implement the running behavior, I've overridden the run method here. In the body of the run method, I've printed that voting is going on for the given design, d, by printing out its name. Also, I've added one vote to the list of votes for that design. Now let's go to the CountingRunnable class. Again, I've implemented the Runnable interface there as well. By doing that, I'm making this class capable of implementing the running behavior that can be executed by a counting thread. Like before, I've implemented the run method. We simply need a counting thread running this behavior to print out that the given Design has got…

Contents