Nevermind, I think I got the answer.
== compares memory location of the variable, .equals compares objects and their own value.
new keyword creates a new memory location for your object.
If you use .equals in your own made class, you must create a method to override it before you can use it properly, but I suppose primitive types with their own Wrapper class and
String objects have their own .equals method?
When you declare a 2 String or any other primitive types of the same value, the
Java Virtual Machine will automatically search for the same value that is previously declared and make a reference to it.
However, when you use the new keyword, a new memory location is created even for String types.
Can someone correct me?