| Author: Deepika Haridas 21 Nov 2008 | Member Level: Diamond | Rating:  Points: 6 |
class Program { int a; int p; public Program() { a = 10; p = 12; } public int A { get { return a; } set { a = value; } } public int P { get { return p; } set { p = value; } } }
Program o1 = new Program(); MessageBox.Show(o1.A.ToString()); MessageBox.Show(o1.P.ToString());
you can use just o1.A
Thanks & Regards, Deepika Editor
If U want to shine like a SUN..First U have to burn like the SUN!! Need a Guide? Join my mentor program..
|
| Author: Deepika Haridas 21 Nov 2008 | Member Level: Diamond | Rating:  Points: 6 |
class Program { int a; int p; public Program() { a = 10; p = 12; } public int A { get { return a; } set { a = value; } } public int P { get { return p; } set { p = value; } } }
Program o1 = new Program(); MessageBox.Show(o1.A.ToString()); MessageBox.Show(o1.P.ToString());
you cant use just o1.A
Thanks & Regards, Deepika Editor
If U want to shine like a SUN..First U have to burn like the SUN!! Need a Guide? Join my mentor program..
|
| Author: Happy Coder 21 Nov 2008 | Member Level: Gold | Rating:  Points: 3 |
try as below, Also post the erro message too.
class MyClass { public static void Main() { Program o1 = new Program(); int a = o1.A; int b = o1.P; } }
Geek is back. ____Happy_Coder____ If you feel this is helpful, RATE IT.
|