Telegram Group & Telegram Channel
Вопрос с собеседования

Зачем в Java нужны volatile переменные, если есть synchronized?

Ответ: volatile обеспечивает немедленную видимость изменений переменной между потоками, но не гарантирует атомарность операций. Он легче и быстрее, чем synchronized, но подходит только для простых сценариев чтения и записи. Для сложных операций, где важна целостность состояния, требуется synchronized или другие механизмы синхронизации.

tags: #собеседование

📱 Java Developer | Чат
Please open Telegram to view this post
VIEW IN TELEGRAM



tg-me.com/java_tg/2916
Create:
Last Update:

Вопрос с собеседования

Зачем в Java нужны volatile переменные, если есть synchronized?

Ответ: volatile обеспечивает немедленную видимость изменений переменной между потоками, но не гарантирует атомарность операций. Он легче и быстрее, чем synchronized, но подходит только для простых сценариев чтения и записи. Для сложных операций, где важна целостность состояния, требуется synchronized или другие механизмы синхронизации.

tags: #собеседование

📱 Java Developer | Чат

BY Java Developer


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/java_tg/2916

View MORE
Open in Telegram


telegram Telegram | DID YOU KNOW?

Date: |

Telegram Be The Next Best SPAC

I have no inside knowledge of a potential stock listing of the popular anti-Whatsapp messaging app, Telegram. But I know this much, judging by most people I talk to, especially crypto investors, if Telegram ever went public, people would gobble it up. I know I would. I’m waiting for it. So is Sergei Sergienko, who claims he owns $800,000 of Telegram’s pre-initial coin offering (ICO) tokens. “If Telegram does a SPAC IPO, there would be demand for this issue. It would probably outstrip the interest we saw during the ICO. Why? Because as of right now Telegram looks like a liberal application that can accept anyone - right after WhatsApp and others have turn on the censorship,” he says.

China’s stock markets are some of the largest in the world, with total market capitalization reaching RMB 79 trillion (US$12.2 trillion) in 2020. China’s stock markets are seen as a crucial tool for driving economic growth, in particular for financing the country’s rapidly growing high-tech sectors.Although traditionally closed off to overseas investors, China’s financial markets have gradually been loosening restrictions over the past couple of decades. At the same time, reforms have sought to make it easier for Chinese companies to list on onshore stock exchanges, and new programs have been launched in attempts to lure some of China’s most coveted overseas-listed companies back to the country.

telegram from ua


Telegram Java Developer
FROM USA