Hi,
In a program i'm working on i got several classes. 3 of them have relation to my
problem. Let's name them classes class A, class B and class C.
classA
{
public static ClassA A = new ClassA( );
public static void Main()
{
Example();
}
public static void Example()
{
ClassB.method1( );
//QUESTION:
//here i want to call the variables set in class B, but i can't do
that since Class B is not know
//in class A. When i say "public static ClassB b = new ClassB a new
"empty" class is made for ClassC
//which does not contain the variables i want.
//How can i ask the needed variables from ClassC in ClassA ????
//I do not want to set the variables in ClassA, i really need and
want this construction !
}
}
ClassB
{
ClassC c = new ClassC( )
public void method1( )
{
c.setVariableA("testValue1");
c.setVariableB("testValue2");
}
}
ClassC
{
string variableA, variableB;
public void setVariableA(string var1)
{
this.variableA = var1;
}
public void setVariableB(string var2)
{
this.variableB = var2;
}
public string getVariableA( )
{
return VariableA;
}
public string getVariableB( )
{
return VariableB;
}
}