Log in from a computer to take this course

You'll need to log in from a computer to start Learn Intermediate Java. But you can practice or keep up your coding streak with the Codecademy Go app. Download the app to get started.

apple storegoogle store
Learn

Congratulations on completing this lesson on threading! So far, you have:

  • created threads in three different ways:
    • extending the Thread class
    • implementing the Runnable class
    • using the in-line, lambda expression syntax
  • started threads with .start()
  • paused the execution of threads using Thread.sleep(long millis)
  • observed thread execution using the supervisor pattern
  • blocked on thread completion with .join()
  • synchronized access to shared resources from threads with the synchronized keyword
  • communicated between threads with .wait() and .notify()

That’s a lot to have covered!

You can now use threading to solve many intermediate and advanced problems when programming with Java. Try to think of more examples like the FortuneTeller or CakeMaker classes, that help to perform multiple tasks at the same time.

Instructions

Take a look at your CakeMaker class, what improvements would you like to make? Play around with the code and see what you can do.

Remember the four principles of Object-Oriented Programming: Inheritance, Polymorphism, Abstraction, and Encapsulation, we left plenty of room to improve in those areas.

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?