Question: I have created a clone of the existing HashSet using clone() and then comparing their references like below:

```
HashSet<Employee> h = new HashSet<>();
HashSet<Employee> h1=(HashSet<Employee>) h.clone();
System.out.println(h==h1);

```

OUTPUT:

```
false

```

Shouldn't this be true since we are creating shallow copies?

Answer: 
Image that you have a 'Fruit' class and an 'Apple' class that extends Fruit. Let's also say that you can 'deCore' an Apple but not a Fruit.

Let's make a variable and set it equal to an apple:

```
Fruit f = new Apple();

```

This is like putting an apple inside of a box labeled 'Fruit'. We have no idea that there is an apple inside - we ONLY know that it is a type of fruit. Therefore, we cannot assume that it is an apple and we can only perform functions that Fruit has. 

In your example, you are putting a Child object inside of a box that is labeled Parent. The Child fits - as it is a type of parent - but the program ONLY knows that it is some type of Parent. Therefore, it can only perform functions that the Parent class has.

I hope that helps!
you can simple cast the class as the child

```
Parent p = new Child(); 
((Child)p).print();

```

as long as `p` is really a `Child` it will work fine otherwise you will run into exception at runtime