CodeGym
CodeGym University
Java FullStack
Learning
Courses
Tasks
Surveys & Quizzes
Games
Help
Schedule
Community
Users
Forum
Chat
Articles
Success stories
Activity
Reviews
Subscriptions
Light theme

Lessons

  • Reviews
  • About us
Start
Start learning
Start learning now
  • My Progress
  • Courses
  • University
  • Quest Map
  • Lessons
  • You've reached Level 17!

    Java Core
    Level 7, Lesson 0
    Congratulations, you've completed the sixth level of the quest! You've touched on an important topic (threads) and completed 34 tasks (or perhaps less if you left some for later). On the seventh level, we'll continue to study threads. In the near future, we'll deal with the static method yield and the keywords synchronized and volatile.
    Available
  • Multithreading problems: accessing a shared resource

    Java Core
    Level 7, Lesson 1
    Threads are, of course, cool and open a world of incredible opportunities (and a heap of complexities) to programmers. Different threads change the state of different objects based on the tasks they perform. And, of course, they can step on each other's toes! But the most frightening part happens deep within the Java machine... Does that sound intriguing?
    Available
  • Tasks involving a shared resource: console output

    Java Core
    Level 7, Lesson 2
    A wise teacher once said that a program is a set of objects that "little robots" (threads) crawl through, executing commands contained in the methods. But the big little robot Diego can't deprive you of the pleasure of doing some tasks involving a shared resource. There are only two, but you're going to have to do some thinking.
    Available
  • Threads aren't independent! Synchronized!

    Java Core
    Level 7, Lesson 3
    Uncontrolled thread switching is another problem. We face a reasonable question: why not let threads do what they want and control their own switching? In fact, this approach creates even more problems. This lesson will teach you about these problems and what can be done.
    Available
  • Synchronized! The practical version

    Java Core
    Level 7, Lesson 4
    Your teacher Diego can't hide anything. He's learned that in the previous lesson you got acquainted with blocking threads, and learned what mutexes are and how to work with them, and what the synchronized keyword is for. Five tasks about synchronized are waiting for you, courtesy of Master Diego!
    Available
  • The local cache: a multithreading problem. Volatile

    Java Core
    Level 7, Lesson 5
    Houston, we have a problem with multithreading! Yes, again. This time it's related to how cache memory is used. The very cache where the processor places its most frequently used variables. It does this to accelerate its work, but herein lies the root of evil. Quite soon, you'll learn what the catch is and how to solve this problem.
    Available
  • Practice with volatile

    Java Core
    Level 7, Lesson 6
    The volatile modifier causes a variable to always be read from and written to normal memory shared by all threads. And thanks to Diego, you won't have to wait to start doing two tasks about volatile. You'll be one small step closer to the title of junior Java developer.
    Available
  • yield (surrendering the right of way)

    Java Core
    Level 7, Lesson 7
    You already know that the processor constantly switches between threads. Each thread is given a quantum — a piece of processor time. When the time is up, the processor switches to another thread and executes its commands. And if you need to end the current thread's quantum prematurely, the Thread class's static method yield comes to your aid!
    Available
  • Useful links from the Professor — 17

    Java Core
    Level 7, Lesson 8
    Especially for you, Professor Noodles found a very interesting lesson online that will teach you a lot more about synchronized, volatile, and yield. He recommends that you study it, but don't go too deep: true immersion in this topic will come a little later.
    Available
  • What’s inside your computer?

    Java Core
    Level 7, Lesson 9
    We need Java and other languages to facilitate communication between people and computers. Handling even simple actions utilizes critical computer components such as peripherals, the input/output subsystem, CPU, and memory. This video explains the steps your computer takes every time you click with the mouse.
    Available
  • Bonus task | Lesson 10 | Level 7

    Java Core
    Level 7, Lesson 10
    Captain Squirrels is on the phone! He has a couple of surprises for you. More precisely, not a couple, and they aren't surprises, but rather ten tasks to reinforce your knowledge about threads. And the truly curious can try their hand on three bonus tasks that are more difficult. For example, in one of them you'll deal with an unlucky waiter in a restaurant.
    Available
Learn
  • Registration
  • Java Course
  • Help with Tasks
  • Pricing
  • Java Syntax
Community
  • Users
  • Articles
  • Forum
  • Chat
  • Success Stories
  • Activity
  • Affiliate Program
Company
  • About us
  • Contacts
  • Reviews
  • Press Room
  • CodeGym for EDU
  • FAQ
  • Support
CodeGym CodeGym is an online course for learning Java programming from scratch. This course is a perfect way to master Java for beginners. It contains 1200+ tasks with instant verification and an essential scope of Java fundamentals theory. To help you succeed in education, we’ve implemented a set of motivational features: quizzes, coding projects, content about efficient learning, and a Java developer’s career.
Follow us
Interface language
English
Deutsch Español हिन्दी Français Português Polski বাংলা 简体中文 मराठी தமிழ் Italiano Bahasa Indonesia 繁體中文 Nederlands 日本語 한국어 Bulgarian Danish Hungarian Basa Jawa Malay Norwegian Romanian Swedish Telugu Thai Українська Filipino Turkish Azərbaycan Русский Vietnamese
Programmers Are Made, Not Born © 2026 CodeGym
MastercardVisa
Programmers Are Made, Not Born © 2026 CodeGym