Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Inner Class & HAS-a class  RSS feed

 
chintan ramavat
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ranchers !

I have quick question,

inner class = has-a class = delegation of task

class A class B {
{ || private C c;
void check () { || void add () {
|| c.add();
Inner i = new Inner(); } }
i.delegate();
}

just wanted to make sure that is that the same thing..
i know access modifiers along like static n outer does not have access to any of inner members but the reverse is true ..and all

thanks in advance

chintan
 
chintan ramavat
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry it's just kinda mix..

class A {

void test () {

Inner i = new Inner(); // it's the same thing of delegation or
i.check(); adding more power to class
}

class B {

private C c ;

void add () {

c.sum(); //here it's just delegation of function to other
class
}

just want to make sure it's the same thing or is there any other underlying features among them

-- sorry for the above
-- thanks in advance

-chintan
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!