为什么这里不抛出错误?(新手提问)
using System;
using System.Collections.Generic;
using System.Text;
namespace Example11_1
{
class Program
{
static void Main(string[] args)
{
Farmer farmer = new Farmer();
farmer.Name = "zhang ";
farmer.Age = 26;
Console.WriteLine(farmer.Age);
Console.WriteLine(farmer.Name);
Console.ReadLine();
}
}
class Farmer
{
public Farmer()
{
}
public Farmer(string m_Name)
{
name = m_Name;
}
//姓名字段
string name = string.Empty;
//MAX字段
const int max = 150;
//MIN字段
const int min = 0;
//AGE字段
int age = 0;
//MAX属性
public int Max
{
get
{
return max;
}
}
//MIN属性
public int Min