1
Answer

Accessing a string from class1 in class2

Stephen Walsh

Stephen Walsh

16y
1.8k
1
I have two seperate classes in a project with no inheritance. Is there any way to access a string which is declared in class 2.
For example.
In class 1 I have a string called HiddenWord.
In class 2 I have an int called AllowableMisses

I want to be able to declare an if statement in class 2 saying:
if (HiddenWord.Length > 5)
{
Allowable misses = 5
}

Is this possible?
Answers (1)