1.

Which method returns the elements of Enum class?(a) getEnums()(b) getEnumConstants()(c) getEnumList()(d) getEnum()The question was posed to me during an online exam.This intriguing question comes from Data Type-Enums in division Data Types, Variables and Arrays of Java

Answer»

The correct answer is (b) getEnumConstants()

The EXPLANATION is: getEnumConstants() returns the elements of this enum CLASS or null if this Class OBJECT does not REPRESENT an enum type.



Discussion

No Comment Found

Related InterviewSolutions