2013年10月31日星期四

You solve ah

Will it help solve this problem brother

first two methods described below have different signatures , and why ?
(1) public int fff (int i, int j, int k)
(2) public float fff (int i, int j, int k)


I see is on Baidu method signature = name + method parameter list

According to Baidu 's argument on two different signatures

But the textbook says the answer is the same

solve ah you. . . . . . . . .
------ Solution ---------------------------------------- ----
as long as the same method name and parameter list , their method signatures for the same , they are fff + int i, int j, int k. Of course, different from his. There's nothing hard to understand
------ Solution ----------------------------------- ---------
method signature does not include the return type.

In a class can not have two names , the arguments are the same way .

So these two methods in a class can only exist in one , so there is no problem of duplicate signatures .
------ For reference only -------------------------------------- -
not wrong, then it should be " design and Analysis of algorithms " ( second edition ) of the title after it answers can you give me a ah guangxuanliu@gmail.com

没有评论:

发表评论