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


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

Re: how does one explain this syntax?

From Roedy Green <inquiry@mindprod.com>
Newsgroups comp.lang.java.programmer
Subject Re: how does one explain this syntax?
Date 2016-05-30 22:00 -0700
Organization Aioe.org NNTP Server
Message-ID <g86qkbp6sdn8m435b76suvsnflmt8q9utl@4ax.com> (permalink)
References <nhrhd5$7r6$1@reader1.panix.com>

Show all headers | View raw


On Sun, 22 May 2016 01:51:33 -0400, ruben safir <ruben@mrbrklyn.com>
wrote:

>      Set set = tmap.entrySet(); <<random obscure syntax... that is a
>constructor for another class?
 
Why should that be obsure?|  It is standard java. You have to look up
the methods.

Set set defines a new variable.  You get the value by taking your
TreeMap and running its entrySet() method.  That get you a Set of
pairs.

I would have written that as:

 final Set<Map.Entry<String, String>> entries = tmap.entrySet();
To preserve the pair structure.

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


Thread

how does one explain this syntax? ruben safir <ruben@mrbrklyn.com> - 2016-05-22 01:51 -0400
  Re: how does one explain this syntax? Martin Gregorie <martin@address-in-sig.invalid> - 2016-05-22 10:05 +0000
  Re: how does one explain this syntax? Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-05-22 07:21 -0400
    Re: how does one explain this syntax? Popping mad <rainbow@colition.gov> - 2016-05-22 20:21 +0000
      Re: how does one explain this syntax? Lars Enderin <lars.enderin@telia.com> - 2016-05-22 22:32 +0200
      Re: how does one explain this syntax? Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-05-22 17:32 -0400
      Re: how does one explain this syntax? Lew <lewbloch@gmail.com> - 2016-05-23 14:36 -0700
    Re: how does one explain this syntax? Lew <lewbloch@gmail.com> - 2016-05-23 14:34 -0700
  Re: how does one explain this syntax? Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2016-05-22 08:41 -0700
    Re: how does one explain this syntax? Robert Klemme <shortcutter@googlemail.com> - 2016-05-22 22:22 +0200
      Re: how does one explain this syntax? Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2016-05-22 22:13 -0700
        Re: how does one explain this syntax? Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-05-23 07:32 -0400
          Re: how does one explain this syntax? Robert Klemme <shortcutter@googlemail.com> - 2016-05-23 04:57 -0700
  Re: how does one explain this syntax? Popping mad <rainbow@colition.gov> - 2016-05-22 20:23 +0000
  Re: how does one explain this syntax? Roedy Green <inquiry@mindprod.com> - 2016-05-30 21:51 -0700
  Re: how does one explain this syntax? Roedy Green <inquiry@mindprod.com> - 2016-05-30 21:54 -0700
  Re: how does one explain this syntax? Roedy Green <inquiry@mindprod.com> - 2016-05-30 22:00 -0700
  Re: how does one explain this syntax? Roedy Green <inquiry@mindprod.com> - 2016-05-30 22:17 -0700

csiph-web