A

Admin • 802.91K Points
Coach

Q. What will happen if you try to instantiate an enum using `new` keyword?

  • (A) It creates a new enum instance
  • (B) It results in a compile-time error
  • (C) It throws a runtime exception
  • (D) It works only inside the enum class

Explanation by: Admin
Enums cannot be instantiated using `new` because their constructors are private and they are implicitly final.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.