if i have a outer class, and inside this outer class there are many inner classes.
do the inner classes in this outer class share any information with each other or are they just stand alone by themselves??
inner classdoes inner classes share information with each others?
Page 1 of 1
5 Replies - 461 Views - Last Post: 19 February 2010 - 03:07 PM
Replies To: inner class
#2
Re: inner class
Posted 18 February 2010 - 07:29 AM
They stand by themselves, just as methods do. Just like no one method knows how the operates, each inner class doesn't know how the others work, only that they do if you choose to have them interact.
#3
Re: inner class
Posted 18 February 2010 - 07:42 AM
#5
Re: inner class
Posted 18 February 2010 - 10:09 PM
macosxnerd101, on 18 February 2010 - 06:29 AM, said:
They stand by themselves, just as methods do. Just like no one method knows how the operates, each inner class doesn't know how the others work, only that they do if you choose to have them interact.
Although, I'm pretty sure InnerClasses share Instance Variables of the outerClass.
#6
Re: inner class
Posted 19 February 2010 - 03:07 PM
YasuoDancez, on 18 February 2010 - 11:09 PM, said:
macosxnerd101, on 18 February 2010 - 06:29 AM, said:
They stand by themselves, just as methods do. Just like no one method knows how the operates, each inner class doesn't know how the others work, only that they do if you choose to have them interact.
Although, I'm pretty sure InnerClasses share Instance Variables of the outerClass.
Yes you are right
class Abc
private int nb;
...
class Inner {
void aMethod() {
nb = 10; // yes I can access my outer class variables
}
}
}
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote







|