Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #32767

Re: A small quiz

Path csiph.com!au2pb.net!feeder.erje.net!1.eu.feeder.erje.net!nntpspool01.opticnetworks.net!aioe.org!.POSTED!not-for-mail
From Arne Vajhøj <arne@vajhoej.dk>
Newsgroups comp.lang.java.programmer
Subject Re: A small quiz
Date Fri, 2 Oct 2015 22:16:31 -0400
Organization Aioe.org NNTP Server
Lines 26
Message-ID <mundq2$em4$1@speranza.aioe.org> (permalink)
References <quiz-20151001125558@ram.dialup.fu-berlin.de> <mujj0q$ttk$1@dont-email.me>
NNTP-Posting-Host 1lM8B9/qdtKBc/uIRK2Gjw.user.speranza.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 8bit
X-Complaints-To abuse@aioe.org
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0
X-Notice Filtered by postfilter v. 0.8.2
Xref csiph.com comp.lang.java.programmer:32767

Show key headers only | View raw


On 10/1/2015 11:22 AM, Knute Johnson wrote:
> On 10/1/2015 05:02, Stefan Ram wrote:
>>    A method m() is declared to have a return type of java.lang.String:
>>
>> java.lang.String m()
>>
>>    . A programmer writes this expression:
>>
>> java.lang.String.valueOf( m() )
>>
>>    (The scope is so that »m« in the above expression refers to the
>>    method »m()« as declared above.)
>>
>>    . Can you find out what might be a good reason the programmer might
>>    have to write this expression? Since the return type of m() already
>>    /is/ java.lang.String, the call to »java.lang.String.valueOf« seems
>>    to be completely superfluous!
>>
>
> If m() returns null String.valueOf would return "null".

Not sure that I would call that a good reason.

Arne

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: A small quiz Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2015-10-01 08:22 -0700
  Re: A small quiz Arne Vajhøj <arne@vajhoej.dk> - 2015-10-02 22:16 -0400

csiph-web