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


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

Re: What is this? (Java syntax)

From Jeff Higgins <jeff@invalid.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: What is this? (Java syntax)
Date 2015-04-14 13:09 -0400
Organization A noiseless patient Spider
Message-ID <mgjhj1$t0n$1@dont-email.me> (permalink)
References <syntax-20150414183627@ram.dialup.fu-berlin.de>

Show all headers | View raw


On 04/14/2015 12:43 PM, Stefan Ram wrote:
>    I found this on a web page:
>
> private enum WinRegistryMethod {
>      OpenKey("WindowsRegOpenKey", int.class, byte[].class, int.class) {
>          @Override
>          protected void verifyReturnValue(Object retValue)
>          ...
>
>    What is the part beginning at »OpenKey«?

A constructor for the enum constant OpenKey of enum type WinRegistryMethod.

>
>    I would understand this if there was a »new« in front of
>    »OpenKey«. In this case, it would be an instance creation
>    expression (anonymous inner class). But there is no »new«.
>
>    According to the web page, the above code is Java code and it
>    seems to have been used successfully. Do I miss some part of
>    the Java syntax?
>
>    Or maybe, the »new« was in the source code of the poster and
>    got lost for some technical reason?
>

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


Thread

Re: What is this? (Java syntax) Jeff Higgins <jeff@invalid.invalid> - 2015-04-14 13:09 -0400
  Re: What is this? (Java syntax) Jeff Higgins <jeff@invalid.invalid> - 2015-04-14 13:24 -0400

csiph-web