Can enums have a constructor?

Now, you know that Enum can have a constructor in Java that can be used to pass data to Enum constants, just like we passed action here. Though Enum constructor cannot be protected or public, it can either have private or default modifier only.7 Kas 2021

Sizin İçin Seçtik  How many values can enum hold?

Leave a Reply

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