What will be the output of following code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace JUSTFORFUN
{
class Program
{
static void Main(string[] args)
{
using (Student s = new Student())
{
Console.WriteLine("Insed Using Bock");
}
Console.Read();
}
}
class Student
{
}
}
Output : Build Error 1 'JUSTFORFUN.Student': type used in a using statement must be implicitly convertible to 'System.IDisposable
What it means is, if we need to use any type in using block that type should implement IDisposable interface.
What it means is, if we need to use any type in using block that type should implement IDisposable interface.
Comments
Post a Comment