| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 780 人关注过本帖
标题:大家帮忙看我理解的对不对
只看楼主 加入收藏
yushengou
Rank: 1
等 级:新手上路
帖 子:401
专家分:0
注 册:2005-3-30
收藏
 问题点数:0 回复次数:7 
大家帮忙看我理解的对不对

using System;

class Constructor1App //定义一个名为Constructor1App的类 { Constructor1App() //创建一个构造器 { Console.WriteLine("[Constructor1App.Constructor1App]"+"I'm the constructor"); }

public static void Main() { Console.WriteLine("\n[Main] Instantiating a"+"Constructor1 object..."); Constructor1App app=new Constructor1App();//声明一个对象类型 Console.ReadLine(); } }

搜索更多相关主题的帖子: public 
2005-04-06 09:17
yushengou
Rank: 1
等 级:新手上路
帖 子:401
专家分:0
注 册:2005-3-30
收藏
得分:0 

再看一个 using System;

class BaseClass { public BaseClass()//定义一个构造器 { Console.WriteLine("[BaseClass.BaseClass]"+"Constructor called"); } }

class DerivedClass:BaseClass//这句话是什么意思??? { public DerivedClass()//定义另一个构造器 { Console.WriteLine("[DerivedClass.Derived]"+"Constructor called"); } } class DefaultInitializer { public static void Main() { Console.WriteLine("[Main] Instantiating a"+"DerivedClass object"); DerivedClass derived=new DerivedClass();//声明一个对象 Console.ReadLine(); } }


我是初学者,希望大家能多多帮助我 /bbs/showimg.asp?BoardID=34&filename=2005-4/200542294030151.gif" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://bbs./bbs/showimg.asp?BoardID=34&filename=2005-4/200542294030151.gif');}" onmousewheel="return imgzoom(this);" alt="" />
2005-04-06 09:35
幻风幻云
Rank: 1
等 级:新手上路
帖 子:762
专家分:0
注 册:2005-1-14
收藏
得分:0 
以下是引用yushengou在2005-4-6 9:35:16的发言:

再看一个 using System;

class BaseClass { public BaseClass()//定义一个构造器 { Console.WriteLine("[BaseClass.BaseClass]"+"Constructor called"); } }

class DerivedClass:BaseClass//这句话是什么意思???类的继承 { public DerivedClass()//定义另一个构造器 { Console.WriteLine("[DerivedClass.Derived]"+"Constructor called"); } } class DefaultInitializer { public static void Main() { Console.WriteLine("[Main] Instantiating a"+"DerivedClass object"); DerivedClass derived=new DerivedClass();//声明一个对象,创建这个类的实例(我觉得这样具体点) Console.ReadLine(); } }

其余理解是正确的


2005-04-06 09:43
yushengou
Rank: 1
等 级:新手上路
帖 子:401
专家分:0
注 册:2005-3-30
收藏
得分:0 
谢谢幻幻。嘎嘎。不介意我这样叫吧

我是初学者,希望大家能多多帮助我 /bbs/showimg.asp?BoardID=34&filename=2005-4/200542294030151.gif" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://bbs./bbs/showimg.asp?BoardID=34&filename=2005-4/200542294030151.gif');}" onmousewheel="return imgzoom(this);" alt="" />
2005-04-06 09:53
幻风幻云
Rank: 1
等 级:新手上路
帖 子:762
专家分:0
注 册:2005-1-14
收藏
得分:0 
没关系
很多人这样叫

2005-04-06 10:02
nyzfl
Rank: 1
等 级:新手上路
帖 子:278
专家分:0
注 册:2005-3-21
收藏
得分:0 
呵呵

My-Blog地址:http://fenglin.
2005-04-06 11:55
live41
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:67
帖 子:12442
专家分:0
注 册:2004-7-22
收藏
得分:0 
以下是引用yushengou在2005-4-6 9:53:51的发言: 谢谢幻幻。嘎嘎。不介意我这样叫吧
紫薇阿姨,你叫得我疙瘩都起了。
2005-04-06 23:53
yichen
Rank: 1
等 级:新手上路
帖 子:303
专家分:0
注 册:2005-3-9
收藏
得分:0 
构造器 也就是构造函数.

衣带渐宽终不悔, 为伊消得人憔悴。 纸上得来终觉浅, 绝知此事要躬行。
2005-04-07 22:10
快速回复:大家帮忙看我理解的对不对
数据加载中...
 
   



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

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