I get slightly obsessed with little details which are often beyond the scope of my immediate study purposes but I can't move on until they're resolved. I don't know whether this is a good or bad thing.
Suppose str1 refers to one String object and str2 refers to another, and I want to compare these for equaility.
The equals() method of str1 object essentially compares its own private final value with that that of the second string. How does it again access to the other sting object's private final value ?
Good question! And curiosity is definitely a good thing!
"private" means that you can only access values of the same class. However, it still allows different instances of the same class to access each other's private variables. Think of it as "private to the class" vs "private to the object".
Accessibility of private members does not work the way you think. Access is determined at compile time and there are no object instances at compile time so the compiler has to use code structure and scope rules. The JLS chapter 6 section 6 has the information about accessibility of members but it's not easy to understand the JLS.