Question discussion

Which of the following statement is false about enum?

148381Medium 1 reply 4,531 views
35
Which of the following statement is false about enum?
  • Aenum can have attribute.
  • Benum can have methods.
  • Cenum constants are public and static.
  • DAn enum can be used to create objects.
Answer not set

Discussion 1

0
CCommunity
An enum is a special "class" that represents a group of constants.

An enum can, just like a class, have attributes and methods. The only difference is that enum constants are public, static and ‘final’ (unchangeable - cannot be overridden).

An enum cannot be used to create objects, and it cannot extend other classes, but it can implement interfaces.