• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 210
  • Last Modified:

One more question of Number of parameters

Hi

As you can see the code, if the question asks you to write down the numbers of parameters and return type.

The answer would be

Number of parameters: 2 (String & double)
Return type: rentHouse ? (I'm not sure)

Thanks.

Thanks.
public boolean rentHouse(String address, double weeklyRent, House rentedHouse)

Open in new window

0
bt1942
Asked:
bt1942
  • 4
  • 2
1 Solution
 
manuel_mCommented:
Ok, same here.

Count the number of parameters.
address of type String
weeklyRent of type double
and rentedHouse obviously of type House.

so we have 3 parameters.

The return type here is between the public modifier and the method name rentHouse.
0
 
bt1942Author Commented:
manuel_m // Ok I see, so the return type is boolean?
0
 
bt1942Author Commented:
manuel_m // Oh ok my mistake.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
bt1942Author Commented:
manuel_m // if they are same like (int day, int month, int year) do you count this as 1 or 3?
0
 
bt1942Author Commented:
Thanks for the comment.
0
 
manuel_mCommented:
> if they are same like (int day, int month, int year) do you count this as 1 or 3?

The count is 3 !

You always have to count all the parameters given in a method. It doesn't matter what type they are :-)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now