Java Fundamentals - Lesson 49 - Using synchronized with methods and Deadlocks

preview_player
Показать описание
Are you new to Java development? Do you want to know what to start with? This is a complete stream dedicated to you - the junior developer or future developer.

- Java OCP 11 certification
- Learn Java basics
- Find a junior java developer role

If your target is at least one of the above, then this lesson streaming is for you. Join!

Don't forget to follow me on Twitter @laurspilca or LinkedIn for more posts and discussions.

Рекомендации по теме
Комментарии
Автор

Clear and solid explanations. Thank You for sharing the knowledge! :)

DeVinhone
Автор

Thanks! can you please make a separate video on the Class loader and the class "java.lang.Class". It is used quite often. Thanks :)

AliHassan-bzsk
Автор

is the coming videos contain an explanation about the reentrant lock?

abdullaelsayed
Автор

Thread t1 = new Thread(){
@Override
public void run() {
a.m1();

}
};


Thread t2 = new Thread(){
@Override
public void run() {
a.m2();

}
};

t1.start();
t2.start();

Question: I didn't understand... you have 1 instance of A called a, when you call the m1 and m2 can they run in parallel? or is it the same thread (I dont think so)... or because you are using this as the monitor it will require first to finish the present thread? and can you alway assume that t1 started first will finish first... or that is not the case... I hope you understand my question...

peterfraga