Path: csiph.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Cecil Westerhof Newsgroups: comp.lang.java.programmer Subject: Calling the other overloaded method Date: Tue, 30 Jul 2019 15:14:00 +0200 Organization: Decebal Computing Lines: 33 Message-ID: <878ssfoeav.fsf@munus.decebal.nl> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="836bcd58d7669a6d0685c847623fc8c3"; logging-data="30961"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+q62EYSED/EiI9VFfV8OwhZddzSm/HRN0=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cancel-Lock: sha1:OiLOxnaV4UC010zTq1Yltox35rg= sha1:GqEfciLDH2ejmx1oCIC/IQe8ceU= Xref: csiph.com comp.lang.java.programmer:39026 I do not think it is important, but better save as sorry: I am doing this in jshell. When I have the following code: Long[] getFibonacciArray() { return null; // getFibonacciArray(0); } Long[] getFibonacciArray(int from) { return getFibonacciStream().skip(from).toArray(Long[]::new); } It compiles without problem. But I want the first method to be: Long[] getFibonacciArray() { return getFibonacciArray(0); } But when using this, I get: | Error: | method getFibonacciArray in class cannot be applied to given types; | required: no arguments | found: int | reason: actual and formal argument lists differ in length | return getFibonacciArray(0); | ^---------------^ What am I doing wrong? -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof