C# Căn Bản Toàn Tập part 8
Số trang: 4
Loại file: pdf
Dung lượng: 120.93 KB
Lượt xem: 19
Lượt tải: 0
Xem trước 2 trang đầu tiên của tài liệu này:
Thông tin tài liệu:
Operators Category Arithmetic Logical String concatenation Increment and decrement Bit shifting Comparison Assignment Member access (for objects and structs) Indexing (for arrays and indexers)
Nội dung trích xuất từ tài liệu:
C# Căn Bản Toàn Tập part 8OperatorsCategory OperatorArithmetic +-*/%Logical & | ^ ~ && || !String concatenation +Increment and decrement ++ --Bit shifting >Comparison == != < > =Assignment = += -= *= /= %= &= |= ^= =Member access (for objects and structs) .Indexing (for arrays and indexers) []Cast ()Conditional (the Ternary Operator) ?:Object Creation newType information sizeof (unsafe code only) is typeof asOverflow exception control checked uncheckedIndirection and Address * -> & (unsafe code only) []Câu sau đây có nghĩa là x bằng với 3:x = 3;Nếu chúng ta muốn so sánh x với một giá trị chúng ta sử dụng kí hiệu sau ==:if (x == 3)Operator ShortcutsBảng dưới đây trình bày một danh sách đầy đủ của shortcut operators có giá trị trong C#:Shortcut Operator Tương đươngx++, ++x x=x+1x--, --x x=x-1x += y x=x+yx -= y x=x–yx *= y x=x*yx /= y x=x/yx %= y x=x%yx >>= y x = x >> yx s += (x == 1 ? man : men);Console.WriteLine(s);isint i = 10;if (i is object){ Console.WriteLine(i is an object);}sizeofstring s = A string;unsafe{ Console.WriteLine(sizeof(int));}Operator PrecedenceGroup Operators () . [] x++ x-- new typeof sizeof checked uncheckedUnary + - ! ~ ++x --x and castsMultiplication/Division */%Addition/Subtraction +-Bitwise shift operators >Relational < > = is asComparison == !=Bitwise AND &Bitwise XOR ^Bitwise OR |Boolean AND &&Boolean OR ||Ternary operator ?:Assignment = += -= *= /= %= &= |= ^= = >>>=
Nội dung trích xuất từ tài liệu:
C# Căn Bản Toàn Tập part 8OperatorsCategory OperatorArithmetic +-*/%Logical & | ^ ~ && || !String concatenation +Increment and decrement ++ --Bit shifting >Comparison == != < > =Assignment = += -= *= /= %= &= |= ^= =Member access (for objects and structs) .Indexing (for arrays and indexers) []Cast ()Conditional (the Ternary Operator) ?:Object Creation newType information sizeof (unsafe code only) is typeof asOverflow exception control checked uncheckedIndirection and Address * -> & (unsafe code only) []Câu sau đây có nghĩa là x bằng với 3:x = 3;Nếu chúng ta muốn so sánh x với một giá trị chúng ta sử dụng kí hiệu sau ==:if (x == 3)Operator ShortcutsBảng dưới đây trình bày một danh sách đầy đủ của shortcut operators có giá trị trong C#:Shortcut Operator Tương đươngx++, ++x x=x+1x--, --x x=x-1x += y x=x+yx -= y x=x–yx *= y x=x*yx /= y x=x/yx %= y x=x%yx >>= y x = x >> yx s += (x == 1 ? man : men);Console.WriteLine(s);isint i = 10;if (i is object){ Console.WriteLine(i is an object);}sizeofstring s = A string;unsafe{ Console.WriteLine(sizeof(int));}Operator PrecedenceGroup Operators () . [] x++ x-- new typeof sizeof checked uncheckedUnary + - ! ~ ++x --x and castsMultiplication/Division */%Addition/Subtraction +-Bitwise shift operators >Relational < > = is asComparison == !=Bitwise AND &Bitwise XOR ^Bitwise OR |Boolean AND &&Boolean OR ||Ternary operator ?:Assignment = += -= *= /= %= &= |= ^= = >>>=
Tìm kiếm theo từ khóa liên quan:
máy tính mạng máy tính internet C# ngôn ngữ C# ngôn ngữ ngôn ngữ lập trình lập trình phần mềm file ứng dụngTài liệu có liên quan:
-
Giáo trình Lập trình hướng đối tượng: Phần 2
154 trang 316 0 0 -
Kỹ thuật lập trình trên Visual Basic 2005
148 trang 309 0 0 -
Giáo trình Hệ thống mạng máy tính CCNA (Tập 4): Phần 2
102 trang 297 0 0 -
Giáo án Tin học lớp 9 (Trọn bộ cả năm)
149 trang 297 0 0 -
Bài thuyết trình Ngôn ngữ lập trình: Hệ điều hành Window Mobile
30 trang 293 0 0 -
Bài giảng: Lịch sử phát triển hệ thống mạng
118 trang 281 0 0 -
Ngân hàng câu hỏi trắc nghiệm môn mạng máy tính
99 trang 278 1 0 -
47 trang 250 4 0
-
NGÂN HÀNG CÂU HỎI TRẮC NGHIỆM THIẾT KẾ WEB
8 trang 248 0 0 -
Bài giảng Một số hướng nghiên cứu và ứng dụng - Lê Thanh Hương
13 trang 247 0 0