When you need to use objects, you need to use Wrapper classes like Integer, Double, Float, etc.
eg:
int n = Integer.parseInt("10");
Here we convert the string to an integer (primitive type), but the parseInt (String str) method only works on Wrapper classes (i.e. Object), so we used it ... you will find much more benefit from it in java.
Kumar Vivek Mitra May 16 '12 at 17:40 2012-05-16 17:40
source share