Santosh Reddy

Santosh Reddy

  • NA
  • 64
  • 19.1k

readonly keyword

May 30 2017 11:59 PM
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication19
{
class a
{
public int www;
readonly string ww = "rrr";
public string check;
}
class b : a
{
public b(int www, string ww)
{
www = 123;
ww = "rrr";
}
public void get()
{
Console.WriteLine("enter details");
this.check = Console.ReadLine();
}
public b()
{
///// if will not taken  in this constructor i got the some error if it given no error  why?
}
public void dis()
{
Console.WriteLine("check is a" + this.check);
}
}
class c : b
{
static void Main(string[] args)
{
a obj = new a();
}
}
}

Answers (2)