Save
Busy. Please wait.
Log in with Clever
or

show password
Forgot Password?

Don't have an account?  Sign up 
Sign up using Clever
or

Username is available taken
show password


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.
Your email address is only used to allow you to reset your password. See 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.
focusNode
Didn't know it?
click below
 
Knew it?
click below
Don't Know
Remaining cards (0)
Know
0:00
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
Popular Computers sets

 

 



Voices

Use these flashcards to help memorize information. Look at the large card and try to recall what is on the other side. Then click the card to flip it. If you knew the answer, click the green Know box. Otherwise, click the red Don't know box.

When you've placed seven or more cards in the Don't know box, click "retry" to try those cards again.

If you've accidentally put the card in the wrong box, just click on the card to take it out of the box.

You can also use your keyboard to move the cards as follows:

If you are logged in to your account, this website will remember which cards you know and don't know so that they are in the same box the next time you log in.

When you need a break, try one of the other activities listed below the flashcards like Matching, Snowman, or Hungry Bug. Although it may feel like you're playing a game, your brain is still making more connections with the information to help you out.

To see how well you know the information, try the Quiz or Test activity.

Pass complete!
"Know" box contains:
Time elapsed:
Retries:
restart all cards