标题:变量类型
取消只看楼主
rgbtdkjcel
Rank: 1
等 级:新手上路
帖 子:294
专家分:0
注 册:2007-3-26
结帖率:50%
 问题点数:0 回复次数:0 
变量类型
using System;
class student
{
public student (double allow,string demand,string location)
{
this.allow=allow;
this.demand=demand;
this.location=location;
}
public double allow;
public string demand;
public string location;
public static readonly student bachelor;
public static readonly student master;
public static readonly student doctor;
static student()
{
bachelor=new student(200,"studious","11楼");
master=new student(1000,"creative","2楼");
doctor=new student(2000,"inventive","3楼");
}
}
class app
{
public static void Main()
{
student student1=student.master;
Console.WriteLine("该学生每月的津贴为:{0}",student1.allow);
Console.WriteLine("该学生的培养标准是:{0}",student1.demand);
Console.WriteLine("该学生住址:{0}",student1.location);
}
}


请问这里的public static readonly student bachelor;public static readonly student master;
public static readonly student doctor;是什么意思呢》

static student()
{
bachelor=new student(200,"studious","11楼");
master=new student(1000,"creative","2楼");
doctor=new student(2000,"inventive","3楼");
}
这些又是什么意思呢???
搜索更多相关主题的帖子: 变量 类型 
2007-09-20 00:06



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-171370-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.238579 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved