Question: I have class as mentioned below:  

```
 public class Test {
     public Test1 a;
     public Test2 b;
 }

```

Now I have 2 threads. 

Thread 1 modifies "Test1" and thread 2 modifies "Test2"  

Can there be a possibility of data corruption i.e. while thread 1 was modifying "Test1" class, but inbetween thread 2 came in and started modifying "Test2" and thus the changes were lost or data was corrupted/incomplete update ?

Answer: 
Something like this

```css
div {
  position: relative;
  text-align:center;
}

img {
  border-radius: 100%;
  border:1px solid #000;
  height:150px;
  width:150px;
}

hr {
  position: absolute;
  width: 555px;
  top:50%;
  z-index:-1;
  border-color: #000;
  margin:0;
}
```

```html
<div>
  <img src="https://placeholdit.imgix.net/~text?txtsize=28&txt=300%C3%97300&w=300&h=300" alt="Image"/>
  <hr>
</div>
```
Here is a solution using `relative` positioning, with comments in the CSS.

The trick is:

* Use `relative` positioning
* Use `z-index` to put one element in front of the other (requires `absolute` or `relative` postitioning.
* With `relative` positioning, `top` and `left` become adjustments.
* Horizontal centering can be achieved using three properties
	+ `display: block;`
	+ `width: …;`
	+ `margin: … auto;` (top-bottom to anything, typically 0; right-left to `auto`).

```css
img {
  border-radius:100%;  /* display as circle */
  position:relative;  /* allow z-index   */

  border: 2px solid #666;  /* display border     */
  z-index: 1000;   /* display in front of hr */
  background-color: white;  /* just in case  */
  display: block;   /* to allow centering */
  width: 150px;   /* same as width in img */
  margin: 0 auto;   /* horizontal centering */
}
hr {
  position:relative;  /* Allow adjustment below: */
  top: -85px;   /* Move up from default */
  width: 555px;

  height: 2px;   /* cross-platform thickness */
  border: none;
  background: #666;
}
```

```html
<img src="https://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon.png?v=c78bd457575a" width="150" height="150">
<hr>
```