change class object

Written by kishore

Suppose i have the following classes:

Code:

class testA
{
public int myVar = 12;
}

class testB
{
public testA m_testa;

public testB ( testA testa )
{
    this.m_testa = testa
}
}


And my main class

Code:

class Main
{

public void blaat()
{
    testA testa = new testA();
    testB testb = new testB(testa);

    testa.myVar = 400;
}
}


So as you can see i create an instance of classA in my Main class and pass that to classB.
What happends when i directly change a value of classA from my Main class and after that display that same value from classB..??

Will the instance of classA that is in classB also know about that change or will that one still hold the old value??

If that’s the case, how can i make it so that when i change a value of classA from Main that the instance of classA in classB will be exactly the same??

Go to Source

Mar
05

All I want is a Dialogue window

Written by kishore

How do I programmatically create a dialogue? I’ve been on the internet for a long time and I can’t find a simple piece of documentation on how to do this. Everything I’ve found has to do creating them from resource templates. I DO NOT want to use a resource file for this.

Go to Source

Mar
05