Your assumption is incorrect, cf. http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--:
It is not required that if two objects are unequal according to the
equals(java.lang.Object) method, then calling the hashCode method on
each of the two objects must produce distinct integer results.
However, if two objects are equal according to the equals(java.lang.Object) method, they must have the same hash code:
If two objects are equal according to the equals(Object) method, then
calling the hashCode method on each of the two objects must produce
the same integer result.
In your example, s1 is equal to s2 according to the equals(java.lang.Object) method, hence the hash code cannot be different without violating its general contract:
public static void main(String[] args) {
String s1=new String("Example");
String s2=new String("Example");
System.out.println(s1.equals(s2)); // true
}
Update:
Regarding your update and to maybe clarify my initial answer. Different from String your Sample class probably overrides neither hashCode() nor equals(java.lang.Object). This means, that the default implementation of Java will be used, which works with the memory location of the current instance (I don't know the exact details, but that should indeed produce different hash codes for different objects). However, this would also imply that s1.equals(s2) would be false for both Sample objects in your example.
Now why would String override equals(java.lang.Object)? Because one would expect that two strings with the same values (i.e. "Example") should be seen as equal by the code. To comply with the general contract between equals(java.lang.Object) and hashCode() (cf. the javadocs from above), String now has to also override the hashCode() method to produce equal hash codes for same values.
Simplified: If String would not override hashCode() to produce the observed output, two different strings could not be equal.
Disclaimer: Note that strings in Java are usually interned and behave slightly different than "regular" objects, but that only for the sake of completeness and further reading. You might also want to read about the differences between equals and ==.
==since the memory adress IS unique to each object.