The term Deadlock refers to a situation in multithreading, where two or more threads are blocked forever, waiting for each other. In Java, we use synchronized keyword to make the class or method thread-safe.The keyword ensures that only one thread can access the resource at a given point of time.