Question 4
class F {
static
String m(float f) {return "f";}
static String m(Float f) {return "F";}
public static void main (String[] args) {
Float f1 = new Float(1);
System.out.print(m(f1.parseFloat("1")));
System.out.print(m(f1.floatValue()));
System.out.print(m(f1.valueOf("1")));
}}
i got this question from dan's
my problem is this:
that program compiles, but one thing eludes me , (parseXXX) and (value of) are both static wrapper method how can they be called using an instance of the wrapper class ?
or am i getting it all wrong?
There was a young man of Cadiz <br />Who inferred that life is what it is , <br />for he early learnt ,<br /> If it were what it weren't ,<br />it could not be that which it is