首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

关于类中的STATIC,该如何处理

2012-01-11 
关于类中的STATICpublicboolcheckUSER(stringconstr,stringusern,stringpassword){}这个函数在A类里但是我

关于类中的STATIC
public   bool   checkUSER(string   constr   ,string   usern,string   password)
        {
        }
这个函数在A   类里
但是我每次引用它的时候我要在先在程序中
A   ss=   new   a
要先NEW   一下才可以用,这样好麻烦   ,要是我在前面加了一个static   就不用了。
请问加了STATIC   会有什么不好吗,假如没有的话,我想都加上STATIC   ,这样我可以直接调用它


[解决办法]
static 函数属于类,非static 属于具体每个对象,

热点排行