38.0k views
1 vote
Consider a method defined with the header: public static void doStuff(int x) Which of the following method calls is legal?

doStuff(0.555);doStuff(9);doStuff(0.1 + 0.2);all of the options are legal except for one doStuff(0.1, 0.2);

User Kith
by
7.9k points

1 Answer

5 votes
the second, because it "asks" for an integer and in all the other calls it is given a float/double
User Dan Kendall
by
8.0k points