Trying to access an instance of a class from within a different class
<p>I am trying to access a function from a class from within a class it was not created in.</p>

<p>Basically I have class A which can do b.refresh();</p>

<p>b obviously contains that function known as refresh. I now want class C to access it.</p>

<p>So in my mind it would be something like c.b.refresh(); but this clearly doesn't work.</p>

<p>What would I need to do to make it work? Only one instance of B is allowed.</p>

<p>Main class:</p>

<pre><code>B b = new b();
b.refresh();
C c = new C();
</code></pre>

<p>Inside C:</p>

<pre><code>function() {
//want to access the same b from Main class.
}
</code></pre>
