22.6k views
3 votes
Suppose that you have created a program with only the following variables

Int age=34
Int weight =180
Double height =5.9
Suppose that you also have a method with the following header:
Public static void calculate (Int age, double size)

Which of the following methods calls are legal and why
Calculate (age, height)
Calculate (weight, weight)

User Milkplus
by
3.2k points

1 Answer

4 votes

Step-by-step explanation:

Calculate (age, height) is legal because method's second argument (double size), needs double value.

User Durin
by
3.3k points