CodeGym /Courses /Java Core /Synchronized! The practical version

Synchronized! The practical version

Java Core
Level 7 , Lesson 4
Available

"Hello, Amigo!"

9
Task
Java Core, level 7, lesson 4
Locked
Synchronized notes
Synchronized notes
5
Task
Java Core, level 7, lesson 4
Locked
Synchronized notes: part 2
Synchronized notes: part 2
9
Task
Java Core, level 7, lesson 4
Locked
Time in the garden
Time in the garden
9
Task
Java Core, level 7, lesson 4
Locked
Synchronized president
Synchronized president
5
Task
Java Core, level 7, lesson 4
Locked
IMF
IMF
Comments (25)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
Ozoda Izzatillaeva Level 27, Uzbekistan
27 April 2023
am I the only one who's not doing these on IntelliJ?
Dmytro Panshyn Level 25, Poland, Poland
6 November 2023
Hi, why you don't use Intellij?) It is more convenient.
19 September 2025
Synchronizing (hah, ironic given which lesson we're at) with the server is agonizingly slow and, for whatever insane reason, has a long cooldown. It's less of a problem for these exercises, but earlier on when solving them was pretty fast it was genuinely awful. It's by far the biggest downside of CodeGym's use of dark matter/unlocking lessons. The only times I've been doing these exercises in the IDE are either when they throw a "you must use IntelliJ" error in the browser (pretty rare) or when you have to use multiple files.
Tasmoda Level 28, Midrand, South Africa
14 July 2022
Low on Dark matter? Worry not, we got you😂. Now you can buy 2 Dark matters for the price of 2! Hurry. Whilst stock lasts!
11 July 2022
This solution has been validated ! and considered better than 60% other students !!!! static { president = new OurPresident(); synchronized (president) { } }
Jurij Thmsn Level 29, Flensburg, Germany
27 March 2021
Can someone explain why in "Synchronized notes" we can't use synchronize(this) ?
Juanf Level 2
23 September 2021
the "lock" (mutex) is a property of an object, so "this" doesn't refer to a block or code, but to the object that owns that block of code when executing. "Notes" is an object (List<>) so you want to synchronize only that object, not the whole Note object that owns "notes" (if you use "this").
Oliver Heintz Level 18, Mustang, United States
12 February 2021
****.class Was this even MENTIONED somewhere? Were we supposed to know to Google this?
Jurij Thmsn Level 29, Flensburg, Germany
27 March 2021
It was mentioned in one of the examples. Didn't get it either. Still don't know what it really means...
Gellert Varga Level 23, Szekesfehervar, Hungary
9 May 2021
I share what i managed to find out from others: synchronized (ClassName.class) : this notation represents the class-level lock instead of the object-level (this). When a class-level lock takes effect, it results in: - locks all synchronized static methods, and - locks all synchronized code blocks marked by ClassName.class. When a thread enters a synchronized block/method, it also locks all other blocks/methods that are synchronized with the same type.
Brad Reed Level 19, Hartford, United States
2 August 2020
Raise your hand if you failed an easy one cuz you didn't read....that would be me....
MaGaby2280 Level 41, Guatemala City, Guatemala
3 February 2020
Great tasks to start practics on synchronization!!!
Trevor Level 23, Phoenix, United States
20 January 2020
Please let us press the escape key to close out the popup modals. It's a pretty basic feature to have in any web app.
Almaz Temirkanov Level 24, Bishkek, Kyrgyzstan
17 September 2019
#5 (imf == null)
28 August 2019
only 267 users have completed the last task up to this point in time... encouraging!
Iasu Level 18, Norway
5 October 2019
How can you see the stats?
7 October 2019
Every time you verify a task the counter shows up ;)
Robert Constantinescu Level 1, Bucharest, Romania
26 November 2019
but only if you complete in IntelliJ
Sela Level 20, Poland
30 July 2020
664 by now
Lawson Level 29, Lagos, Nigeria
31 August 2020
it doesnt show in mine..
Sansho Level 19, Bordeaux, France
11 June 2021
1027 by now
aijo Level 30, Germany, Germany
13 February 2022
1143 now