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

bt1942Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
manuel_mConnect With a Mentor Commented:
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
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.