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.4

Cert Obj Create top level and nested classes

[2.4.5] Inner(non static nested) class (not top level, I) A nested class is declared inside curly braces of another class. An inner class is a nested class that is not explicitly or implicitly (eg member of an interface ) declared static.
[2.4.1] Method-local inner (L) Defined within a method of the enclosing class
[2.4.2] Order for instantiate and use (L) Complete class definition, then instantiate and use!!
[2.4.3] Access to which variables (L) final. Even if final variable x is present in outer class, if defined within a static method, the method cannot access x without this
[2.4.4] Only modifiers (L) either final or abstract
[2.4.0] How to remember (Rules for inner classes) L-I-S-A
[2.4.6] Only modifiers (I) All modifiers like other members + final or abstract
[2.4.7] Relationship with O (I) Inner class can access even the private members of O
[2.4.8] Order for instantiate and use (I) MyInner mi = new MyInner // from within class MyOuter mo= new MyOuter(); MyOuter.MyInner inner = mo.new Inner(); // from outside class use reference to Outer ('this' if referring to Inner, Outer.this if referencing Outer instance)
[2.4.9] Anonymous Inner (A) subclass of named type OR implementer of named interface });
[2.4.10] use (A) only those defined in reference variable type
[2.4.11] restricted how? (A) either extend one class or implement exactly one interface. (anonymous class is implicitly final)
[2.4.12] instantiation (A) declared, defined and instantiated as part of a method invocation- ended by } and ) for method call and ; for statement
[2.4.13] static nested class (is top level, S) (SIC alert - do not say static inner class!!!!) inner class but with static modifier, really not inner class! A static nested class is behaviorally a top-level class that has been nested in another top-level class for packaging convenience.
[2.4.14] Relationship with O (S) None (Declaring a nested class static only means that instances of the class are created without having an outer instance. )
[2.4.15] instantiation (S) BigOuter.Nested x = new BigOuter().Nested();
[2.4.16] restricted how? (S) cannot access nonstatic members of O because no implicit reference ie outer this (instances of the class are created without having an outer instance. The members of the static class can be static or not.)
[2.4.17] Only modifiers (S) Static nested classes can be declared as final or abstract
[2.4.18] Polymorphism (S) Can extend; can be extended
[2.4.19] Members (S) Only type of nested class that can have static members
[2.4.20} Nested classes Cannot access nested class elements without an instance of outer class (eg Outer.this.x)
[2.4.21] Interface Can only have static nested class since interface members are implicitly public and static
[2.4.22] Remember that if class implements interface it implicitly extends Object and hence cannot extend other ref 2.4.11 If anonymous class is created for interface, it extends Object class and implement that interface, if it is created for a class then it extends that class.
[2.4.23] compile time constants Earlier, Non-static inner classes were not allowed to have static fields at all. This rule is now modified and as per the new rule inner classes are allowed to declare static final fields that are compile time constants as members.
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