Re: toString() method be always used in place of (String) cast
toString returns the String representation of any object. It calls the overridden method of the respective object to get the string representation. String and other classes have implemented that method properly and hence you get the proper string representation. Casting just specify the compiler to read the respective value differently and there is no function call. If your pupose is to cast, use casting only.