- ex. CallValue(a,b);
2.傳址呼叫:
- 定義方法:
private static void CallRef(ref int x,ref int y)
{
} - 呼叫方法:
CallRef(ref a,ref b);
3.傳出參數:
- 再呼叫敘述及被呼叫方法參數的引數串列參數前面加上out
- ex.
private static void CallOut(out int x,out int y); - ex.
Callout(out a,out b);
4.區塊變數:
- 只在for、while裡宣告的變數
5.區域變數:
- 只在函式裡宣告的變數
6.靜態變數:
- 用static裡宣告的變數
- ex. private static int age=25;
沒有留言:
張貼留言