---
title: "Can Java object be locked down for exclusive use by a given thread?"  
description: "Can Java object be locked down for exclusive use by a given thread?"  
author: "Anonymous User"  
published: 2015-05-07  
updated: 2020-09-18  
canonical: https://www.mindstick.com/interview/2500/can-java-object-be-locked-down-for-exclusive-use-by-a-given-thread  
category: "java"  
tags: ["java", "threading"]  
reading_time: 1 minute  

---

# Can Java object be locked down for exclusive use by a given thread?

Yes. You can lock an object by putting it in a "synchronized" block. The locked object is inaccessible to any thread other than the one that explicitly claimed it.

## Answers

### Answer by Anonymous User

Yes. You can lock an object by putting it in a "synchronized" block. The locked object is inaccessible to any thread other than the one that explicitly claimed it.


---

Original Source: https://www.mindstick.com/interview/2500/can-java-object-be-locked-down-for-exclusive-use-by-a-given-thread

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
