文章分类 -  C#语法

摘要:参数数列 参数数列能够使多个相关的参数被单个数列代表,换就话说,参数数列就是变量的长度。 using System; class Test { static void F(params int[] args) { Console.WriteLine("# 参数: {0}", args.Length); for (int i = 0; i... 阅读全文

posted @ 2006-09-15 23:33 raekwon |

摘要:接口using System;using System.Collections;// Declare the collection and implement the IEnumerable interface:public class MyCollection: IEnumerable { int[] items; public MyCollection() { item... 阅读全文

posted @ 2006-09-15 23:31 raekwon |

摘要:explicit与implicit必须声明为static和public using System;struct RomanNumeral{ public RomanNumeral(int value) { this.value = value; } static public implicit operator RomanNumeral(i... 阅读全文

posted @ 2006-09-15 23:28 raekwon |

摘要:属于 默认的成员可访问性 该成员允许的声明的可访问性 ... 阅读全文

posted @ 2006-09-15 23:22 raekwon |

摘要:using System; abstract class A{ public void F() { Console.WriteLine("A.F"); } public abstract void G(); internal virtual void a() { Console.WriteLine("A.F"); }}... 阅读全文

posted @ 2006-09-15 23:13 raekwon |

摘要:代码: static void Main(string[] args) { int guess, number, guesses = 0; number = new Random((int)DateTime.Now.Ticks).Next( 0, 10 ); do { ++guesses; Console.Write( "Enter a number b... 阅读全文

posted @ 2006-08-29 22:31 raekwon 阅读(117) 评论(0) 推荐(0) |

摘要:using System; namespace _10_Relations { /**//// /// Summary description for Class1. /// class ComparingRelations { /**//// /// The main entry point for the application. /// [STAThread... 阅读全文

posted @ 2006-08-29 22:28 raekwon 阅读(139) 评论(0) 推荐(0) |

摘要:using System;namespace _3_MultEntryPoints{ class EntryPointTest { class Main1Entry { [STAThread] static void Main(string[] args) { Console.WriteLine( "Running in Main" ); } } class Ma... 阅读全文

posted @ 2006-08-29 22:24 raekwon 阅读(361) 评论(0) 推荐(0) |

博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3