This is a simple one, it's just that I can't figure out what it means.
Is it 4 different methods or one method with 4 parameters.
+ (double)doCalc:(flo开发者_如何学Pythonat)interestRate
numOfCompounds:(int)interestFrequency
intialDeposited:(float)deposit
lengthOfTimeBanked:(int)period;
What confuses me is where it comes out with numOfCompounds:(int)interestFrequency.
Does it means it's a separate parameter?
Thanks in advance.
This is all one method. The method declaration doesn't end until the closing ;
.
That is one method with four parameters. The whitespace and line breaks are there only for readability.
The four parameters are:
interestRate
, a floatinterestFrequency
, an intdeposit
, a floatperiod
, an int
The name of the method, without the parameter signatures, is actually
doCalc:numOfCompounds:intialDeposited:lengthOfTimeBanked:
In one of the parts of the signature, for example numOfCompounds:(int)interestFrequency
, numOfCompounds
is the name of the parameter as seen by the calling code, while interestFrequency
is the name of the parameter in the scope of the method.
精彩评论