Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #39026
| Path | csiph.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Cecil Westerhof <Cecil@decebal.nl> |
| 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> (permalink) |
| 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 |
Show key headers only | View raw
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
Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread
Calling the other overloaded method Cecil Westerhof <Cecil@decebal.nl> - 2019-07-30 15:14 +0200 Re: Calling the other overloaded method "Jeffrey H. Coffield" <jeffrey@digitalsynergyinc.com> - 2019-07-30 06:47 -0700 Re: Calling the other overloaded method Lars Enderin <lars.enderin@telia.com> - 2019-07-30 17:32 +0200
csiph-web