• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 216
  • 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

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