Which of the following is the correct way to define the constructor(s) of the Sample class if we are to create objects as per the C#.NET code snippet given below?
Sample s1 = new Sample(); Sample s2 = new Sample(5.6f);
public Sample() { i = 0; j = 0.0f; } public Sample (int ii, Single jj) { i = ii; j = jj; }
public Sample (Optional int ii = 0, Optional Single jj = 0.0f) { i = ii; j = jj; }
public Sample (int ii, Single jj) { i = ii; j = jj; }
Sample s;
s = new Sample();
What will be the output of the C#.NET code snippet given below?
namespace IndiabixConsoleApplication { class Sample { static Sample() { Console.Write("Sample class "); } public static void Bix1() { Console.Write("Bix1 method "); } } class MyProgram { static void Main(string[ ] args) { Sample.Bix1(); } } }
Is it possible to invoke Garbage Collector explicitly?
Which of the following statements is correct?
In which of the following should the methods of a class differ if they are to be treated as overloaded methods?
Can static procedures access instance data?
Which of the following statements is correct about constructors in C#.NET?
Which of the following statements are correct about the C#.NET code snippet given below?
class Sample { static int i; int j; public void proc1() { i = j = } public static void proc2() { i = j = } static Sample() { i = j = } }
Which of the following statements is correct about the C#.NET code snippet given below?
namespace IndiabixConsoleApplication { class Sample { public int func() { return } public Single func() { return 2.; } } class Program { static void Main(string[ ] args) { Sample s1 = new Sample(); int i; i = s1.func(); Single j; j = s1.func(); } } }
Which of the following statements are correct about constructors in C#.NET?
namespace IndiabixConsoleApplication { class Sample { public static void fun1() { Console.WriteLine("Bix1 method"); } public void fun2() { fun1(); Console.WriteLine("Bix2 method"); } public void fun2(int i) { Console.WriteLine(i); fun2(); } } class MyProgram { static void Main(string[ ] args) { Sample s = new Sample(); Sample.fun1(); s.fun2(123); } } }
Bix1 method 123 Bixl method Bix2 method
Bix1 method 123 Bix2 method
Bix2 method 123 Bix2 method Bixl method
Bixl method 123
Bix2 method 123 Bixl method
Which of the following ways to create an object of the Sample class given below will work correctly?
class Sample { int i; Single j; double k; public Sample (int ii, Single jj, double kk) { i = ii; j = jj; k = kk; } }
How many times can a constructor be called during lifetime of the object?
Is it possible for you to prevent an object from being created by using zero argument constructor?
Which of the following statements are correct about static functions?
Which of the following statements is correct about constructors?
Please disable the adBlock and continue. Thank you.