C#ÈëÃÅ
±äÁ¿¡¢³£Á¿¼°±í´ïʽ±äÁ¿ºÍ³£Á¿±äÁ¿(¾²Ì¬¡¢·Ç¾²Ì¬¡¢Êý×éÔªËØ¡¢Öµ²ÎÊý¡¢ÒýÓòÎÊý¡¢Êä³ö²ÎÊý¡¢¾Ö²¿±äÁ¿)¾²Ì¬(static) Èç public static int x; Ò»µ©¾²Ì¬±äÁ¿ËùÊôµÄÀà±»×°ÔØ£¬Ö±µ½°üº¬¸ÃÀàµÄ³ÌÐòÔËÐнáÊøʱËüÒ»Ö±´æÔÚ¡£·Ç¾²Ì¬£º²»´øÓÐstaticÐÞÊηûÉùÃ÷µÄ±äÁ¿³ÆΪʵÀý±äÁ¿£¬Èçint a ;³£Á¿(attributes constnt-modifiers CONST type contant-declarators)ÆäÖУ¬ÐÞÊηûconstant-modifier ¿ÉÒÔÊÇ£ºnew,public,protected,internal,privatetype±ØÐëÊÇÒÔÏÂÖ®Ò»:sbyte,byte,short,ushort,int,uint,long,ulong,char,float,double,decimal,bool,string,ö¾Ù(enum),ÒýÓÃÀàÐÍ(reference-type);contant-declarators±íʾ³£Á¿µÄÃû×Ö¡¡¡¡È磺public const double x=1.0;+ ÔËËã·û¼È¿É×÷ΪһԪÔËËã·ûÒ²¿É×÷Ϊ¶þ½øÖÆÔËËã·û¡£+expr1 or expr1+expr2Console.Writeline(+5) //Return 5Console.Writeline(5+5) //Return 10Console.Writeline(5+.5) //Return 5.5Console.Writeline(“5”+“5”) //Return 55Console.Writeline(5.0+“5”) //Return 55¡¡¡¡×Ô¶¯½«DOUBLEת»»³ÉSTRING- ÔËËã·û¼È¿É×÷ΪһԪÔËËã·ûÒ²¿É×÷Ϊ¶þ½øÖÆÔËËã·û¡£-expr1 or expr1-expr2int a=5Console.Writeline(-a); //return -5Console.Writeline(a-1); //return 4* ³Ë·¨ÔËËã·û (*) ¼ÆËã²Ù×÷ÊýµÄ³Ë»ý¡£ËùÓÐÊýÖµÀàÐͶ¼¾ßÓÐÔ¤¶¨ÒåµÄ³Ë·¨ÔËËã·û¡£expr1*expr2Using Systemclass Test{ Public static void main() { Console.Writeline(5*2); //return 10 Console.Writeline(-.5*.2) //return -0.1 Console.Writeline(-.5m*.2m) //return -0.10 СÊýÀàÐÍ }}/ ³ý·¨ÔËËã·û (/) Óõڶþ¸ö²Ù×÷Êý³ýµÚÒ»¸ö²Ù×÷Êý¡£ËùÓÐÊýÖµÀàÐͶ¼¾ßÓÐÔ¤¶¨ÒåµÄ³ý·¨ÔËËã·û¡£expr1/expr2Console.Writeline(-5/2) //return -2Console.Writeline(-5.0/2) //return -2.5% Ä£ÊýÔËËã·û (%) ¼ÆËãµÚ¶þ¸ö²Ù×÷Êý³ýµÚÒ»¸ö²Ù×÷ÊýºóµÄÓàÊý¡£ËùÓÐÊýÖµÀàÐͶ¼¾ßÓÐÔ¤¶¨ÒåµÄÄ£ÊýÔËËã·û¡£expr1%expr2Console.Writeline(5%2) //return 1 intConsole.Writeline(-5%2) //return -1 intConsole.Writeline(5.0%2.2) 
Ïà¹ØÎĵµ£º
/// <summary>
/// Ö§³ÖXMLÐòÁл¯µÄ·ºÐÍ Dictionary
/// </summary>
/// <typeparam name="TKey"></typeparam>
/// <typeparam name="TValue"></typeparam>
[XmlRoot("SerializableDictionary")]
public class SerializableDictionary<TKey, TValue& ......
RT¡£ÏÈÌù´úÂë
C# code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Value_Ref_test1
{
class Program
{
static void Main(string[] args)
{
point a = new point (10,10) ;
point b = a;
......
ÏÈÌù´úÂë
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Ref_and_Out_test
{
class Program
{
static void Main(string[] args)
& ......
1. ÃüÃû¹æ·¶
a) Àà
¡¾¹æÔò1-1¡¿Ê¹ÓÃPascal¹æÔòÃüÃûÀàÃû£¬¼´Ê××ÖĸҪ´óд¡£
¡¾¹æÔò1-2¡¿Ê¹ÓÃÄܹ»·´Ó³À๦ÄܵÄÃû´Ê»òÃû´Ê¶ÌÓïÃüÃûÀà¡£
¡¾¹æÔò1-3¡¿²»ÒªÊ¹ÓÓI”¡¢“C”¡¢“_”µÈÌض¨º¬Òåǰ׺¡£
¡¾¹æÔò1-4¡¿×Ô¶¨ÒåÒì³£ÀàÓ¦ÒÔException½áβ¡£
¡¾¹æÔò1-5¡¿ÎļþÃûÒªÄÜ·´Ó ......
ΪʲôҪʹÓÃC#·ºÐÍ?
ΪÁËÁ˽âÕâ¸öÎÊÌ⣬ÎÒÃÇÏÈ¿´ÏÂÃæµÄ´úÂ룬´úÂëÊ¡ÂÔÁËһЩÄÚÈÝ£¬µ«¹¦ÄÜÊÇʵÏÖÒ»¸öÕ»£¬Õâ¸öÕ»Ö»ÄÜ´¦ÀíintÊý¾ÝÀàÐÍ£º
public class Stack
{
private int[] m_item;
public ......