Accessing Objects from remote classes...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • balgach@gmail.com

    #1

    Accessing Objects from remote classes...

    Lets say i have this scenerio

    class A {
    public B objB; //B is my own class
    main() {
    objB = new B();
    C objC = new C();
    ....

    }

    class B {
    B() {}
    public void aFunt() {..}
    ...
    }

    class C {
    C() {
    objB.aFunt();
    }
    }

    basically im in class C, and i need to call functions in class B, which
    was origionally instantionated in class A.

    Does this make any sense? im trying to access/manip an object in
    class A, from class C, so that when class C unloads, all the tweaking
    its done to the object stays permant. (the object just happens to be
    of type B) is this even possible?

    Cheers,
    Adam.

  • Ulf_N

    #2
    Re: Accessing Objects from remote classes...

    balgach@gmail.c om skrev:[color=blue]
    > Lets say i have this scenerio
    >
    > class A {
    > public B objB; //B is my own class
    > main() {
    > objB = new B();
    > C objC = new C();
    > ...
    >
    > }
    >
    > class B {
    > B() {}
    > public void aFunt() {..}
    > ...
    > }
    >
    > class C {
    > C() {
    > objB.aFunt();
    > }
    > }
    >
    > basically im in class C, and i need to call functions in class B, which
    > was origionally instantionated in class A.
    >
    > Does this make any sense? im trying to access/manip an object in
    > class A, from class C, so that when class C unloads, all the tweaking
    > its done to the object stays permant. (the object just happens to be
    > of type B) is this even possible?
    >
    > Cheers,
    > Adam.
    >[/color]

    class A {
    public B objB; //B is my own class
    main() {
    objB = new B();
    C objC = new C(objB);
    ....

    }

    class C {
    C(B objB) {
    objB.aFunt();
    }
    }

    Comment

    Working...