Create | Hello Guest |
class Student s1, s2; // Here 'Student' is a user-defined class.s1 = new Student();s2 = new Student();
class Sample{private int i;public Single j;private void DisplayData(){Console.WriteLine(i + " " + j);}public void ShowData(){Console.WriteLine(i + " " + j);}}
namespace IndiabixConsoleApplication{class Sample{int i;Single j;public void SetData(int i, Single j){i = i;j = j;}public void Display(){Console.WriteLine(i + " " + j);}}class MyProgram{static void Main(string[ ] args){Sample s1 = new Sample();s1.SetData(10, 5.4f);s1.Display();}}}
namespace IndiabixConsoleApplication{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);}}}
sample c;c = new sample();