🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.java
Article #154149

Re: getter, który się wykonuje ale nic nie zwraca

#154149
From: Arivald
Date: Wed, 15 Apr 2015 11:58
31 lines
1954 bytes
On 2015-04-15 12:37, Jadalbert wrote:
> W dniu środa, 15 kwietnia 2015 12:13:17 UTC+2 użytkownik Arivald napisał:
>> On 2015-04-15 10:42, Jadalbert wrote:
>>> @Override
>>> public double getSuma3Bokow() {
>>> throw new UnsupportedOperationException("Not supported yet.");
>>> }
>>> ale ja nie chcę żadnych komunikatów.
>>> Po prostu rezultatem wykonania tej metody ma być "null".
>>> Z góry dziękuję za opinie.
>>>
>>
>> No to zwróć null. w czym problem?
>>
>> --
>> Arivald
>
> Ma być double, więc się kompilatore rzuca: incompatible types: <null> cannot be converted to double. :(
>

No to nie okłamuj nas w pytaniu, pisałeś:
 >>> Po prostu rezultatem wykonania tej metody ma być "null".

Skoro nie możesz nulla, to nie możesz.

Co możesz?
Na przykład zwrócić NaN.
Albo zmień rezultat na Double.

-- 
Arivald
Technical Details
Message-ID: <mgll4a$402$1@mx1.internetia.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.nask.pl!news.nask.org.pl!news.internetia.pl!not-for-mail
References: <d7a3ef5a-592e-4008-9628-d8dfb40110c4@googlegroups.com> <mglevf$dhs$1@mx1.internetia.pl> <ce30085e-747c-4bab-ad8d-609ca5af543e@googlegroups.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.nask.pl!news.nask.org.pl!news.internetia.pl!not-for-mail
From: Arivald <NOSPAMarivald@interia.pl>
Newsgroups: pl.comp.lang.java
Subject: Re: getter, który się wykonuje ale nic nie
 zwraca
Date: Wed, 15 Apr 2015 13:58:09 +0200
Organization: Netia S.A.
Lines: 32
Message-ID: <mgll4a$402$1@mx1.internetia.pl>
References: <d7a3ef5a-592e-4008-9628-d8dfb40110c4@googlegroups.com> <mglevf$dhs$1@mx1.internetia.pl> <ce30085e-747c-4bab-ad8d-609ca5af543e@googlegroups.com>
NNTP-Posting-Host: 78.8.98.11
Mime-Version: 1.0
X-Trace: mx1.internetia.pl 1429100490 4098 78.8.98.11 (15 Apr 2015 12:21:30 GMT)
X-Complaints-To: abuse@inetia.pl
NNTP-Posting-Date: Wed, 15 Apr 2015 12:21:30 +0000 (UTC)
user-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.0
X-Tech-Contact: usenet@internetia.pl
in-reply-to: <ce30085e-747c-4bab-ad8d-609ca5af543e@googlegroups.com>
X-Server-Info: http://www.internetia.pl/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit