N
N
Neic2015-09-14 19:33:31
Java
Neic, 2015-09-14 19:33:31

assert and synchronized in java?

Please explain these two constructions, googling somehow did not really explain.
Assert is not clear at all. And synchronized, as I understand it, blocks some block in such a way that only one thread can access it and this block cannot be executed in parallel. If I understand correctly, what are these cases when this is needed, if possible, also with a code example.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question