Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Karina K patni   on Aug 04 In Java Category.

  
Question Answered By: Velma Adams   on Aug 04

in response to your query of calling  the method in the outer class  from the
inner class, here is the solution.
declare the method test  in the outer class as static and then see.it works.
code:

class A
{
static int test() { return  1; }
class B
{
int test() { return A.test(); } // this is the proxy I want
to do without
}
}

class C extends A.B
{
C(A a)
{
a.super();
}

void stuff()
{
System.out.println(test());
}

public static void main(String[] args)
{
A a = new A();
C c = new C(a);
c.stuff();
}
}


pls let me know if u have any other clarifications needed in ur program.

Share: 

 

This Question has 18 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Inner class inherit question Or get search suggestion and latest updates.


Tagged: