Access public class member from other class
Suppose, i have 2 classes
public class A
{
public string s1;
}
public class B
{
}
Is there anyway to use string 's1' from class A in class B ?
My conditions are:
- " string s1 " is non-static variable. ( just public )
- In class B, i will not use " A a = new A(); a.s1 = "hello"; "
to access string s1. (not new it).
5 Answers
Know the answer? Post it. Somebody with the same question will find it here.
mibuytRank #3,026 · 476 pointsPosted Mar 14, 2005, 4:46 AM EST
hellopeat8 pointsPosted Mar 14, 2005, 4:49 AM EST
mibuytRank #3,026 · 476 pointsPosted Mar 14, 2005, 5:10 AM EST
MykonineRank #2,671 · 515 pointsPosted Mar 14, 2005, 6:33 AM EST
mibuytRank #3,026 · 476 pointsPosted Mar 14, 2005, 2:52 PM EST