| 发表于:2007-01-31 16:19:24 楼主 |
using system; using system.collections.generic; using system.text; using system.drawing; namespace consoleapplication1 { public class userprefernces { public static readonly color backcolor; static userpreferences() { datetime now=datetime.now; if(now.dayofweek==dayofweek.saturday ¦ ¦now.dayofweek==dayofweek.sunday) backcolor=color.green; else backcolor=color.red; } private userpreferences() { } } class mainentrypoint { static void main(string[] args) { console.writeline( "user-preferences: backcolor is: "+userprefernces.backcolor.tostring()); } } } 我这都是照着书写的,但是编译提示说 “类、结构或接口方法必须有返回类型” 无法编译啊,怎么回事??? |
|
|
|
|