Guide to the Language


B Bitwise operators,  18 C


Download 2 Mb.
Pdf ko'rish
bet78/78
Sana30.04.2023
Hajmi2 Mb.
#1414515
TuriGuide
1   ...   70   71   72   73   74   75   76   77   78
Bog'liq
C sharp

B
Bitwise operators
18
C
Calling methods, 
38
Class
accessing object members, 
50
anonymous type, 
63
constructor
chaining, 
53
default value, 
54
initial field values, 
53
method, 
51
object initializers, 
54
overloading, 
52
default value, 
62
destructor, 
56
garbage collector, 
56
member access operator (.), 
50
nullable types


184
non-nullable reference 
types, 
59
null-coalescing
operator (??), 
60
null-conditional
operator (?.), 
61
PropertyGroup
element, 
59
reference, 
59
value, 
58
null keyword, 
57,
 
58
object creation, 
49
partial class, 
55
property types, 
63
this keyword, 
52
type inference, 
62
Combined assignment operators, 
16
Comparison operators, 
17
Compilation
comments, 
6,
 
7
console, 
5
language version, 
6
Visual Studio, 
5
Concatenation
operator, 
21,
22
Conditional statements, 
29
Goto, 
31
if statement, 
29,
30
switch
assignment expression, 
32
statement, 
30
ternary operator, 
32
Constants
fields, 
172
guideline, 
175
local constant, 
171
in parameters, 
174
readonly, 
172,
 
173
Constructor method, 
51
Conversion methods
explicit, 
136
implicit, 
135,
 
136
D
Delegates
anonymous methods, 
146
lambda expressions, 
147–149
multicast, 
149
parameter types, 
150–152
signature, 
145
Do-while loop, 
33
E
Enumeration (enum variable)
access levels, 
119
constant elements, 
118
GetNames() function, 
119
int/ToString method, 
119
scope, 
119
switch statement, 
117
typeof operator, 
119
Events, 
153
caller, 
154
keyword, 
154
Class (cont.)
INDEX


185
publisher, 
153
raising events, 
155
subscriber, 
157
EventHandler, 
156
publisher class, 
156
Exception handling, 
121
catch block, 
122
error message, 
121
filters, 
123
finally block, 
124–126
throwing exceptions
127,
128
try-catch statement, 
122
using statement, 
126
Explicit conversion methods, 
136
F
Floating-point types, 
12
Foreach loop, 
35
G
Garbage collector, 
56
Generics, 
159
base class constraint, 
168
calling methods, 
160,
161
classes, 
162
constraints, 
166
default value, 
162
delegates, 
165
events, 
165
inheritance, 
163
interfaces, 
164
methods, 
159
multiple constraints, 
168
object type, 
166
type parameters, 
161
use of, 
168
Goto statement, 
31
H
Hello World
IDE, 
1
IntelliSense, 
3
main method, 
3
project creation, 
2
WriteLine method, 
3
I
Implicit conversion
methods, 
135,
 
136
Increment (++) and decrement (--) 
operators, 
16
Indexers
data, 
97
get and set methods, 
97
overloading, 
99
parameters, 
98
ranges and indexes, 
100
Inheritance
boxing, 
67
downcast and upcast, 
66,
67
is and as operators, 
67,
 
68
object class, 
65
INDEX


186
pattern matching, 
68–70
rectangle class, 
65
unboxing, 
67
Integrated Development 
Environment (IDE), 
1
IntelliSense, 
3
Interfaces, 
103
class interface, 
105
default implementations, 
106,
 
107
functionalities, 
105
IComparable method, 
104
signatures, 
103
J, K
Jagged arrays, 
27
L
Lambda expressions
body definition, 
148
expression lambda, 
148
input parameter, 
147
operator (=>), 
147
statement lambda, 
148
Local constant, 
171
Logical operators, 
17
Loops
break and continue
35
do-while, 
33
for, 
34
foreach, 
35
while, 
33
M
Methods
calling methods, 
38
defining methods, 
37
local methods, 
47
named arguments, 
41
optional parameters, 
40
out keyword, 
46
overloading, 
39
parameters, 
38,
 
39
params keyword, 
39
pass by value, 
43
recursive method, 
47
reference data types, 
43
ref keyword, 
44,
45
return statement, 
41
value and reference
types, 
42
Multicast delegates, 
149
MyPrint method, 
38
N
Namespaces
access, 
114
directives, 
115
naming convention, 
113
nested namespaces,
113,
 
114
static directive, 
116
Null-coalescing
expression, 
128
Null keyword, 
57,
58
Inheritance (cont.)
INDEX


187
O
Operator overloading, 
129
binary, 
130
MyNum object, 
129
overloadable operators, 
131
return and parameter type, 
131
true and false, 
132
unary operator, 
130
Operator precedents, 
18
P, Q
Preprocessor
conditional compilation, 
142
diagnostic directives, 
141,
 
143
#error directive, 
143
line directive, 
144
region directives, 
144
syntax, 
142
#warning directive, 
143
Properties
access levels, 
94
accessors, 
91
advantages of, 
92
auto-implemented, 
95
contextual value keyword
91
read-only and write-only, 
94
R
Read-only and write-only 
properties, 
94
Rectangular array, 
26
Redefining members
base keyword, 
74
differences, 
73
hiding members, 
71
overriding members, 
72
signature, 
71
Return statement, 
41
S
Static methods
access, 
86
advantage of, 
86
classes, 
87
constructor, 
88
extension methods, 
89
fields, 
87
instance methods, 
85
local function, 
88
String
compare, 
23
concatenation operator, 
21,
 
22
data type, 
21
escape characters, 
22,
 
23
members, 
23
StringBuilder class, 
24
verbatim string, 
23
StringBuilder class, 
24
Struct keyword, 
137
constructors, 
138
field initializers, 
139
guideline, 
140
inheritance, 
139
variable, 
137
Switch statement, 
30
INDEX


188
T, U
Ternary operator, 
32
Throwing exceptions, 
127,
128
ToString method, 
21
Type inference, 
62
V
Variables
assignment, 
10
bool type, 
13
char type, 
12
data types, 
9
declaration, 
10
floating-point types, 
12
integer types, 
11
scope of, 
13
verbatim string, 
23
Visual Studio compilation, 
5
W, X, Y, Z
While loop, 
33
WriteLine method, 
3
INDEX

Document Outline

  • Table of Contents
  • About the Author
  • About the Technical Reviewer
  • Introduction
  • Chapter 1: Hello World
    • Choosing an IDE
    • Creating a Project
    • Hello World
    • IntelliSense
  • Chapter 2: Compile and Run
    • Visual Studio Compilation
    • Console Compilation
    • Language Version
    • Comments
  • Chapter 3: Variables
    • Data Types
    • Declaration
    • Assignment
    • Integer Types
    • Floating-Point Types
    • Char Type
    • Bool Type
    • Variable Scope
  • Chapter 4: Operators
    • Arithmetic Operators
    • Assignment Operators
      • Combined Assignment Operators
      • Increment and Decrement Operators
    • Comparison Operators
    • Logical Operators
    • Bitwise Operators
    • Operator Precedents
  • Chapter 5: Strings
    • String Concatenation
    • Escape Characters
    • String Compare
    • String Members
    • StringBuilder Class
  • Chapter 6: Arrays
    • Array Declaration
    • Array Allocation
    • Array Assignment
    • Array Access
    • Rectangular Arrays
    • Jagged Arrays
  • Chapter 7: Conditionals
    • If Statement
    • Switch Statement
    • Goto Statement
    • Switch Expression
    • Ternary Operator
  • Chapter 8: Loops
    • While Loop
    • Do-While Loop
    • For Loop
    • Foreach Loop
    • Break and Continue
  • Chapter 9: Methods
    • Defining Methods
    • Calling Methods
    • Method Parameters
    • Params Keyword
    • Method Overloading
    • Optional Parameters
    • Named Arguments
    • Return Statement
    • Value and Reference Types
    • Pass by Value
    • Pass by Reference
    • Ref Keyword
    • Out Keyword
    • Local Methods
  • Chapter 10: Class
    • Object Creation
    • Accessing Object Members
    • Constructor
    • This Keyword
    • Constructor Overloading
    • Constructor Chaining
    • Initial Field Values
    • Default Constructor
    • Object Initializers
    • Partial Class
    • Garbage Collector
    • Destructor
    • Null Keyword
    • Nullable Value Types
    • Nullable Reference Types
    • Null-Coalescing Operator
    • Null-Conditional Operator
    • Default Values
    • Type Inference
    • Anonymous Types
  • Chapter 11: Inheritance
    • Object Class
    • Downcast and Upcast
    • Boxing
    • Unboxing
    • The Is and As Keywords
    • Pattern Matching
  • Chapter 12: Redefining Members
    • Hiding Members
    • Overriding Members
    • Hiding and Overriding
    • Sealed Keyword
    • Base Keyword
  • Chapter 13: Access Levels
    • Private Access
    • Protected Access
    • Internal Access
    • Protected Internal Access
    • Private Protected Access
    • Public Access
    • Top-Level Access Levels
    • Inner Classes
    • Access Level Guideline
  • Chapter 14: Static
    • Accessing Static Members
    • Static Methods
    • Static Fields
    • Static Classes
    • Static Constructor
    • Static Local Functions
    • Extension Methods
  • Chapter 15: Properties
    • Property Advantages
    • Read-Only and Write-Only Properties
    • Property Access Levels
    • Auto-implemented Properties
  • Chapter 16: Indexers
    • Indexer Parameters
    • Indexer Overloading
    • Ranges and Indexes
  • Chapter 17: Interfaces
    • Interface Signatures
    • Interface Example
    • Functionality Interface
    • Class Interface
    • Default Implementations
  • Chapter 18: Abstract
    • Abstract Members
    • Abstract Example
    • Abstract Classes and Interfaces
  • Chapter 19: Namespaces
    • Nested Namespaces
    • Namespace Access
    • Using Directive
  • Chapter 20: Enum
    • Enum Example
    • Enum Constant Values
    • Enum Constant Type
    • Enum Access Levels and Scope
    • Enum Methods
  • Chapter 21: Exception Handling
    • Try-Catch Statement
    • Catch Block
    • Exception Filters
    • Finally Block
    • Using Statement
    • Throwing Exceptions
  • Chapter 22: Operator Overloading
    • Operator Overloading Example
    • Binary Operator Overloading
    • Unary Operator Overloading
    • Return Types and Parameters
    • Overloadable Operators
    • True and False Operator Overloading
  • Chapter 23: Custom Conversions
  • Chapter 24: Struct
    • Struct Variable
    • Struct Constructors
    • Struct Field Initializers
    • Struct Inheritance
    • Struct Guideline
  • Chapter 25: Preprocessors
    • Preprocessor Syntax
    • Conditional Compilation Symbols
      • Conditional Compilation
      • Diagnostic Directives
      • Line Directive
      • Region Directives
  • Chapter 26: Delegates
    • Anonymous Methods
    • Lambda Expressions
      • Expression Body Members
    • Multicast Delegates
    • Delegate Signature
    • Delegates as Parameters
  • Chapter 27: Events
    • Publisher
    • Event Keyword
    • Event Caller
    • Raising Events
    • Subscriber
    • Subscribing to Events
  • Chapter 28: Generics
    • Generic Methods
    • Calling Generic Methods
    • Generic Type Parameters
    • Default Value
    • Generic Classes
    • Generic Class Inheritance
    • Generic Interfaces
    • Generic Delegates
    • Generic Events
    • Generics and Object
    • Constraints
    • Multiple Constraints
    • Why Use Constraints
  • Chapter 29: Constants
    • Local Constants
    • Constant Fields
    • Readonly
    • In Parameters
    • Constant Guideline
  • Chapter 30: Asynchronous Methods
    • The Async and Await Keywords
    • Async Return Types
    • Custom Async Methods
    • Extended Return Types
    • Async Streams
  • Index

Download 2 Mb.

Do'stlaringiz bilan baham:
1   ...   70   71   72   73   74   75   76   77   78




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling