Busy. Please wait.
or

show password
Forgot Password?

Don't have an account?  Sign up 
or

Username is available taken
show password

why


Make sure to remember your password. If you forget it there is no way for StudyStack to send you a reset link. You would need to create a new account.
We do not share your email address with others. It is only used to allow you to reset your password. For details read our Privacy Policy and Terms of Service.


Already a StudyStack user? Log In

Reset Password
Enter the associated with your account, and we'll email you a link to reset your password.

Remove Ads
Don't know
Know
remaining cards
Save
0:01
To flip the current card, click it or press the Spacebar key.  To move the current card to one of the three colored boxes, click on the box.  You may also press the UP ARROW key to move the card to the "Know" box, the DOWN ARROW key to move the card to the "Don't know" box, or the RIGHT ARROW key to move the card to the Remaining box.  You may also click on the card displayed in any of the three boxes to bring that card back to the center.

Pass complete!

"Know" box contains:
Time elapsed:
Retries:
restart all cards




share
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.

  Normal Size     Small Size show me how

OCPJP702.5

Cert Obj Use enumerated types

[2.5.1] enum stands for list of constant values assigned to a type
[2.5.2] enum type enum constant's type is the enum type
[2.5.3] where it cannot be declared in a method or constructor!
[2.5.4] what it cannot have as modifier when declared outside a class protected-private-abstract-static-final
[2.5.5] what it can have constructors, methods, variables, and constant-specific class bodies
[2.5.6] constructor can have argument enum constants can send arguments to the enum constructor, using the syntax BIG(8), where the int literal 8 is passed to the enum constructor.
[2.5.7] constructor can be overloaded enum constructors can have arguments and can be overloaded
[2.5.8] constructor cannot be invoked by your code called automatically when an enum is initialized.
[2.5.9] have or not have semicolon - both are legal
[2.5.10] illegal for enum Unlike a regular java class, you cannot access a non-final static field from an enum's constructor. ( JLS 8.9.2 )
[2.5.11] Enum declaration rules Enum constants (here, DOG, CAT, and FISH) must be declared before anything else. Can have an anonymous subclass of enum in constructor
[2.5.12] enum constructor cannot be public (either explicitly is implicitly private)
[2.5.13] polymorphism a) An enum is impliclty final, which means you cannot extend it. b). You cannot extend an enum from another enum or class because an enum implicitly extends java.lang.Enum. But an enum can implement interfaces.
[2.5.14] clone() Since enum maintains exactly one instance of its constants, you cannot clone it. You cannot even override the clone method in an enum because java.lang.Enum makes it final.
[2.5.15]values() 5. Compiler provides an enum with two public static methods automatically -  values() and valueOf(String). The values method returns an array of its constants
[2.5.16] valueOf(String) valueOf(String) tries to match the String argument exactly (i.e. case sensitive) with an enum constant and returns that constant if successful otherwise it throws java.lang.IllegalArgumentException.
[2.5.17] comparable() It implements java.lang.Comparable (thus, an enum can be added to sorted collections such as SortedSet, TreeSet, and TreeMap).
[2.5.18] ordinal() It has a method ordinal(), which returns the index (starting with 0) of that constant i.e. the position of that constant in its enum declaration.
[2.5.19] name() It has a method name(), which returns the name of this enum constant, exactly as declared in its enum declaration.
Created by: MVK2013