This is polymorphism.
What is the difference between these examples?
Example one creates a "pointer" to the space in memory of a type of a Set. That means that you will have ability to manipulate that space in memory using all methods declared in the Set interface.
Example two creates a "pointer" to the space in memory of a type of a HashSet. That means that you will have ability to manipulate that space in memory using all methods declared in the HashSet class.
Or they are the same?
It depends on what you are going to do after those two lines. Set is a common contract for the Set-like collections but sometimes we need more specific methods. That is when you need to downcast you Object to a more specific type. Interfaces are supposed to deal with the commonality.
(1) example looks like upcasting, so it means that we have HashSet with only Set(interface) methods?
Yes.