What will be the output of the following C# code? [code] class sample { int i; double k; public sample (int ii, double

What will be the output of the following C# code?
Code:
  class sample
  {
      int i;
      double k;
      public sample (int ii, double kk)
      {
          i = ii;
          k = kk;
          double j = (i) + (k);
          Console.WriteLine(j);
      }
      ~sample()
      {
          double j = i - k;
          Console.WriteLine(j);
      }
  }
  class Program
  {
      static void Main(string[] args)
      {
          sample s = new sample(8, 2.5);
          Console.ReadLine();
      }
  }
A. 0 0
B. 10.5 0
C. Compile time error
D. 10.5 5.5
 

Tìm kiếm

Back
Top