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


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

Re: Every expression has a type?

Path csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!ipa.eternal-september.org!.POSTED!not-for-mail
From Jukka Lahtinen <jtfjdehf@hotmail.com.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Every expression has a type?
Date Tue, 31 Oct 2017 12:00:28 +0200
Organization A noiseless patient Spider
Lines 24
Message-ID <m3d1537i2r.fsf@sonera.fi> (permalink)
References <Every-20171030130857@ram.dialup.fu-berlin.de> <m3po94xrte.fsf@sonera.fi> <null-20171030231708@ram.dialup.fu-berlin.de>
Mime-Version 1.0
Content-Type text/plain
Content-Transfer-Encoding 8bit
Injection-Info ipa.eternal-september.org; posting-host="29008d6ba4f4f0600a8794d9a8721812"; logging-data="32459"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19kBtW0qjoOtJ1W3OhmbgAG"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)
Cancel-Lock sha1:tSFJG1uV2QU2lSY1G2v+4Z4az9s= sha1:YulbGi8ShwjJXc1vIidkE0WDo0U=
X-no-archive yes
Xref csiph.com comp.lang.java.programmer:37617

Show key headers only | View raw


ram@zedat.fu-berlin.de (Stefan Ram) writes:
> Jukka Lahtinen <jtfjdehf@hotmail.com.invalid> writes:
>>How about null?
>>Is it cosidered to have a type, since null can be any type at all?

>   I have written this exercise.
>   Try to predict the output of the following program.

> public final class Main
> {
>   private static void f( final java.lang.Object o )
>   { java.lang.System.out.println( "Bject" ); }
>
>   private static void f( final java.lang.String s )
>   { java.lang.System.out.println( "Tring" ); }
>
>   public static void main( final java.lang.String[] args )
>   { f( null ); }}

Actually I'm surprised of the output of that.
Just the opposite of what I thought.

-- 
Jukka Lahtinen

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


Thread

Re: Every expression has a type? Jukka Lahtinen <jtfjdehf@hotmail.com.invalid> - 2017-10-30 23:13 +0200
  Re: Every expression has a type? Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-10-30 18:07 -0400
  Re: Every expression has a type? Jukka Lahtinen <jtfjdehf@hotmail.com.invalid> - 2017-10-31 12:00 +0200
    Re: Every expression has a type? Robert Klemme <shortcutter@googlemail.com> - 2017-10-31 14:40 +0100

csiph-web