reference icon indicating copy to clipboard operation
reference copied to clipboard

Poor wording on enum page

Open Velumuthali opened this issue 1 year ago • 3 comments

Enumerations "An enum where no constructors contain fields are called a field-less enum."

  1. grammar: are called may be changed to is called.
  2. possibly misleading: "where no constructors" . The plural 'constructors' suggests that more than one constructor is allowed. My idea: If an enum constructor contains no fields, the enum is called a field-less enum.

Velumuthali avatar Feb 17 '24 08:02 Velumuthali

For 2: Each variant of an enum has it's own constructor. None of these may have any fields for the enum as a whole to be called a field-less enum.

bjorn3 avatar Feb 17 '24 08:02 bjorn3

Sir bjorn3, Thank you for pointing out the inexactness my suggestion. I stand corrected. But I humbly feel "Each variant of an enum has it's own constructor" is suspicious. This may do better: For 2 If every variant of an enum that has a constructor has no field in the constructor, then the enum is called a field-less enum.

Velumuthali avatar Feb 17 '24 16:02 Velumuthali

@bjorn3 As a non-native speaker I agree with @Velumuthali on his/her suggestion.

ahmed-mohamed-eng avatar Mar 23 '24 05:03 ahmed-mohamed-eng