Can enum values be strings?

Every enum has both a name() and a valueOf(String) method . The former returns the string name of the enum, and the latter gives the enum value whose name is the string.

Sizin İçin Seçtik  Can enum have constructor in Java?

Leave a Reply

Your email address will not be published. Required fields are marked *