What is Operators in VB.NET in Hindi
Types of Operators in VB.NET in Hindi - VB.NET में ऑपरेटर्स के प्रकार
Operator | Symbol |
---|---|
OperatorArithmetic | Symbol+, -, *, /,\, Mod |
OperatorComparison | Symbol=,<, <=, > ,>=, <>,Like, Is |
OperatorAssignment | Symbol = |
OperatorLogical/Bitwise | Symbol And, or, Not, Xor, AndAlso, OrElse, IsFalse, IsTrue |
OperatorBit Shift | Symbol<<, >> |
OperatorMiscellaneous | SymbolAddresOf, GetType |
Arithmetic operators
Module Arithmeticoperators
Sub Main ()
Dim a,b,c As Integer
a= 50
b =20
c= a+b
Console.WriteLine ("Addition of a and b is :"&c)
c= a-b
Console.WriteLine ("Substraction of a and b is :"&c)
c= a*b
Console.WriteLine ("Multiplication of a and b is :"&c)
c=a/b
Console.WriteLine ("Division of a and b is :"&c)
c= a mod b
Console.WriteLine ("Mod of a and b is :"&c)
Console.ReadLine()
End Sub
End Module
Comparison/Relational operators
Module Comparisonoperators
Sub Main()
Dim a As Integer = 17
Dim b As Integer = 23
Dim result As Boolean
result = a > b
Console.WriteLine("a>b is:" & result)
result = a < b
Console.WriteLine("a<b is:" & result)
result = a <= b
Console.WriteLine("a<=b is: " & result)
result = a = b
Console.WriteLine("a=b is : " & result)
result = a <> b
Console.WriteLine("a<> b is:" & result)
Console.ReadLine()
End Sub
End Module
Logical operators
Module Logicaloperators
Sub Main()
Dim a As Integer = 10
Dim b As Integer = 17
Console.WriteLine( a> 6 And b<18)
Console.WriteLine(a>6 or b<17)
Console.WriteLine(not b>18)
End Sub
End Module
Assignment operators
Module AssignmentOperator
Sub Main()
Dim a As Integer = 15
Dim b As Integer
b = a
Console.WriteLine("Value of b is : " & b)
Console.ReadLine()
End Sub
End Module
Bitwise Operators
Module Bitwiseoperators
Sub Main()
Dim x As Integer = 3
Dim y As Integer = 5
Dim result As Integer
Dim result1 As Integer
result = x And y
Console.WriteLine("Bitwise Result of x And y is : " & result)
result = x or y
Console.WriteLine("Bitwise Result of x or y is : " & result)
result = x XOR y
Console.WriteLine("Bitwise Result of x XOR y is : " & result)
result1 = Not x
Console.WriteLine("Bitwise Result of Not x is : " & result1)
Console.ReadLine()
End Sub
End Module
Bit Shift Operators
Module Bitleftshiftoperator
Sub Main()
Dim originalnum As Integer = 5
Dim leftshiftednum As Integer = originalnum<< 3
Console.WriteLine("Original number: " & originalnum)
Console.WriteLine("Left Shifted Number is : " & leftshiftednum)
Console.ReadLine()
End Sub
End Module
Module BitrightshiftOperator
Sub Main()
Dim originalnum As Integer = 15
Dim rightshiftednum As Integer = originalnum >> 3
Console.WriteLine("Original number: " & originalnum)
Console.WriteLine("Right Shifted Number is :"& rightshiftednum))
Console.ReadLine()
End Sub
End Module
Miscellaneous Operators
AddressOf
- AddressOf Operator का प्रयोग एक Method या Function का Memory Address प्राप्त करने में होता है।
- इसका उपयोग करके हम बाद मे उस Function या Method को call कर सकते हैं।
Await
- Asynchronous operation में कई Tasks एक साथ Execute किए जाते है और अगले Task के आगे बढ़ने से पहले Program को प्रत्येक Task के पूरे होने का इंतजार करना नही पड़ता।
- VB.NET मे Await Operator के साथ asynchronous programming के लिए मज़बूत Support प्रदान करता है।
- Await Operators का प्रयोग किसी asynchronous programming के पहले यह इंगित करने के लिए किया जाता है कि किसी Task की प्रतीक्षा की जा रही है।
- यह Complier को Awaited Task के पूरा होने तक Current Method के Execution को Suspand करने के लिए कहता है।
- Await Operators VB.NET में asynchronous programming की आधारशिला है।
- किसी Task या Method को Call करने से उसके आगे Await Keywords का Use करने से यह Compiler को प्रतीक्षित कार्य पूरा होने तक Current Method के Execution को निलंबित करने का निर्देश देता है।
- इस बीच, Application अन्य कोड को Execute करना जारी रख सकता है।
Get Type
- Get Type operator, को 'GetType', Keyword से Represent किया जाता है।
- यह Runtime में एक Object के Type संबन्धित Information को प्राप्त करने की अनुमति देते है।
- इन Information में Type का नाम, Base Type, कार्यान्वित Interface और उससे ज्यादा रहता है।
Function Expression
- VB.NET में Function Expression operator को 'Function' keyword से Denote किया जाता है ।
- यह आपको Code के अंदर एक functions परिभाषित करने की अनुमति देते है।
- function expression operator का Syntax 'Function' keyword के साथ शुरू होता है।
- उसके बाद function name, Parameter है तो उसके लिए parentheses का Set और वैकल्पिक Return Type होते है ।
- Function की body को End Function से Close करते है।
- इस Operator का प्रयोग एक बड़े Function के अंदर Function को Define करने, Anonymous Function बनाने या एक Variable को Function Assign करने मे भी होता है।
If
- VB.NET में If operator का प्रयोग conditional statements के लिए किया जाता है।
- यह आपको Condition Check करने और यदि Condition True है तो एक Value Return करने की तथा Condition False है तो अन्य Value Return करने की अनुमति देते है।
0 टिप्पणियाँ