Calling a method inside another method in same class

前端 未结 5 819
北海茫月
北海茫月 2020-11-29 03:25

In page 428 (the chapter about Type Information) of his \"Thinking In Java, 4th Ed.\", Bruce Eckel has the following example:

public class Staff extends Arra         


        
5条回答
  •  甜味超标
    2020-11-29 03:57

    It is not recursion, it is overloading. The two add methods (the one in your snippet, and the one "provided" by ArrayList that you are extending) are not the same method, cause they are declared with different parameters.

提交回复
热议问题