3
อะไรคือ ?[]? ไวยากรณ์ใน C #?
ขณะที่ผมกำลังศึกษาผู้ร่วมประชุมที่เป็นจริงในระดับนามธรรมDelegate.csผมเห็นวิธีการต่อไปในที่ที่ฉันไม่เข้าใจ เหตุใดค่าส่งคืนจึง?ถึงแม้ว่ามันเป็นชนิดการอ้างอิง ( คลาส ) อยู่แล้ว ?[]? ความหมายกับพารามิเตอร์ คุณอธิบายได้ไหม public static Delegate? Combine(params Delegate?[]? delegates) { if (delegates == null || delegates.Length == 0) return null; Delegate? d = delegates[0]; for (int i = 1; i < delegates.Length; i++) d = Combine(d, delegates[i]); return d; }