Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #32754
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: A small quiz |
| Date | 2015-10-01 12:49 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <mujo2p$jtr$1@dont-email.me> (permalink) |
| References | <quiz-20151001125558@ram.dialup.fu-berlin.de> <muj8i2$iuj$2@dont-email.me> <c4e3bc51-840d-443c-ba12-b91b0e139d38@googlegroups.com> <mujk3i$3j8$1@dont-email.me> <45bae432-2df5-4878-832b-11c465d666d8@googlegroups.com> |
On 10/01/2015 11:59 AM, Eric Douglas wrote:
>
> So the valueOf is pointless?
> I tried this little test program:
> public static void main(String[] args) {
> String s = null;
> System.out.println(s);
> System.out.println(String.valueOf(s));
> System.out.println(String.valueOf(null));
> }
> It didn't crash until it tried to get the valueOf the constant.
>
It would have, hadn't PrintStream checked for a null.
public void print(String s) {
if (s == null) {
s = "null";
}
write(s);
}
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: A small quiz Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-10-01 08:24 -0400
Re: A small quiz e.d.programmer@gmail.com - 2015-10-01 08:33 -0700
Re: A small quiz Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-10-01 11:41 -0400
Re: A small quiz Eric Douglas <e.d.programmer@gmail.com> - 2015-10-01 08:59 -0700
Re: A small quiz Jeff Higgins <jeff@invalid.invalid> - 2015-10-01 12:49 -0400
Re: A small quiz Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-10-01 13:02 -0400
Re: A small quiz Eric Douglas <e.d.programmer@gmail.com> - 2015-10-01 10:19 -0700
Thanks (Was: A small quiz) j4n bur53 <janburse@fastmail.fm> - 2015-10-02 00:12 +0200
Re: A small quiz Mike Amling <mamling@chaff.us> - 2015-10-02 09:18 -0500
csiph-web