| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
共有 696 人关注过本帖
标题:关于构造函数的问题
取消只看楼主 加入收藏
wangzhilong_
Rank: 1
来 自:四川
等 级:新手上路
帖 子:7
专家分:5
注 册:2011-10-17
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:0 
关于构造函数的问题
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace 基础学习02
{
    public class Work
    {
   
        public uint number;
        public short time;
        public short absence;
        public Work( uint b, short c, short d)
        {
        
            number = b;
            time = c;
            absence = d;
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            Work wk = new Work( 1233, 12, 111);
            Console.WriteLine(wk);
            Console.ReadKey();
         }
     }
}
运行出来是:
“namespace 基础学习.Work“
为什么构造函数运行出来只有空间名和类名其余什么都没有啊??
怎么没有输出类中的对象??
2011-10-23 21:42
快速回复:关于构造函数的问题
数据加载中...
 
   



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

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