namespace CuriousTabConsoleApplication { class Sample { public int index; public int[] arr = new int[10]; public void fun(int i, int val) { arr[i] = val; } } class MyProgram { static void Main(string[] args) { Sample s = new Sample(); s.index = 20; Sample.fun(1, 5); s.fun(1, 5); } } }
int i; int j = new int(); i = 10; j = 20; String str; str = i.ToString(); str = j.ToString();
namespace CuriousTabConsoleApplication { class Sample { int i, j; public void SetData(int ii, int jj) { this.i = ii; this.j = jj } } class MyProgram { static void Main(string[ ] args) { Sample s1 = new Sample(); s1.SetData(10, 2); Sample s2 = new Sample(); s2.SetData(5, 10); } } }
class Sample { private int i; public Single j; private void DisplayData() { Console.WriteLine(i + " " + j); } public void ShowData() { Console.WriteLine(i + " " + j); } }
sample c; c = new sample();
Copyright ©CuriousTab. All rights reserved.