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


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

Re: What is this? (Java syntax)

Started byJeff Higgins <jeff@invalid.invalid>
First post2015-04-14 13:09 -0400
Last post2015-04-14 13:24 -0400
Articles 2 — 1 participant

Back to article view | Back to comp.lang.java.programmer

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  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

#31568 — Re: What is this? (Java syntax)

FromJeff Higgins <jeff@invalid.invalid>
Date2015-04-14 13:09 -0400
SubjectRe: What is this? (Java syntax)
Message-ID<mgjhj1$t0n$1@dont-email.me>
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?
>

[toc] | [next] | [standalone]


#31570

FromJeff Higgins <jeff@invalid.invalid>
Date2015-04-14 13:24 -0400
Message-ID<mgjiej$1et$1@dont-email.me>
In reply to#31568
On 04/14/2015 01:09 PM, Jeff Higgins wrote:
> 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.

An example:
<http://www.basilv.com/psd/blog/2006/advanced-uses-of-java-5-enums>

>
>>
>>    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?
>>
>

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web