| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 501 人关注过本帖
标题:变量类型
取消只看楼主 加入收藏
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
快速回复:变量类型
数据加载中...
 
   



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

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