class Sample { private int i; public Single j; private void DisplayData() { Console.WriteLine(i + " " + j); } public void ShowData() { Console.WriteLine(i + " " + j); } }
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); } } }
int i; int j = new int(); i = 10; j = 20; String str; str = i.ToString(); str = j.ToString();
sample c; c = new sample();
namespace CuriousTabConsoleApplication { class Sample { int i; Single j; public void SetData(int i, Single j) { this.i = i; this.j = j; } public void Display() { Console.WriteLine(i + " " + j); } } class MyProgram { static void Main(string[ ] args) { Sample s1 = new Sample(); s1.SetData(36, 5.4f); s1.Display(); } } }
class Student s1, s2; // Here 'Student' is a user-defined class. s1 = new Student(); s2 = new Student();
Comments
There are no comments.Copyright ©CuriousTab. All rights reserved.