Why use putFloat (String key, float value), putInt (String key, int value) instead of overloading put (...)

This is a general question about programming best practices. I am analyzing the Android API and found that many methods are not overloaded. For example, SharedPreferences have many methods for storing various types of variables, the Google Use Agreement:

putFloat(String key, float value) putInt(String key, int value) 

instead

 put(String key, float value) put(String key, int value) 

Why? The seams of the second approach will be more OOP.

+6
source share

All Articles