Which four are true about enums?
A.
An enum is typesafe.
B.
An enum cannot have public methods or fields.
C.
An enum can declare a private constructor.
D.
All enums implicitly implement Comparable.
E.
An enumcan subclass another enum.
F.
An enum can implement an interface.
Explanation:
C:The constructor for an enum type must be package-private or private access.Reference: Java Tutorials,Enum Types
A C D F
C F are TRUE
D. – NO !!!
All enums implicitly implement Comparable -> not true
Enums are sorted by default in order of their declariation, not by natural order
Really? So check it:
public class TestClass
{
private enum Q { A, B, C, D }
public static void main(String [] args) throws Exception
{
Comparable