Naveen Immidis

Greenhorn
+ Follow
since Jul 03, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Naveen Immidis

Finally took the exam on the last day of the voucher and cleared it.
[ July 01, 2004: Message edited by: Naveen Immidis ]
20 years ago
The "==" method doesnt return true, because if you do a new, then the Thread pool is not utilised to reference an existing object. The Hashcode contract specifies that two identical objects should return the same hashcode. Since the two strings are identical in values, the hashcode produced by them is the same.
I think they are just distinct coding practices. The important thing to remeber is, once you have assigned a value to a final variable, then you cannot reassign it again. The 2nd style can thus be used, say where you would like to initialise a final variable inside a constructor