Welcome To Search How
Hello dosto good noon, friends humne apni peechli post main pda tha Java Arrays ke bare main or dosto ab hum study karenge Java Operators ke bare main to chaliye dosto ab hum java operators ke bare main seekhte hain.
Java Operators Introduction In Hindi
Dosto hum bhi hum variables pe operations perform karte hain to uske liye operators ka hi use karna hota hai, dosto isme har ek data type pe alag alag operations perform kiye jate hain or yehi kaaran hai operators ke alag alag use karne ka bhi.Dosto is time yaha par operators ki hi baat chal rahi hai to hum aapko batana chahte hain ki operators ke 2 types hote hain pehla hai Unary or dusra hai Binary, dosto jab bhi hum kisi variable ko operators ke saath use karte hain to usko hum operand kehte hain, friends humesha Unary operator 1 operand ke saath apply kiya jata hai or agar hum baat kare Binary operators ki to ye 2 operands pe apply hote hain.
Friends agar hum java ke ander operators ki baat kare to isme 6 type ke operators hote hain or vo operators hain รจ
- Logical Operators
- Relational Operators
- Assignment Operators
- Arithmetic Operators
- Conditional Operators
- Bit wise Operators
Logical Operators In Hindi
Friends ye operators vo operators hote hain jinko boolean values pe perform karne ke liye use kiya jata hai, friends ye operators 3 trah ke hote hain, dosto is trah ke operations main dono variables ki value true ya false ho sakti hai. for example รจ
Operator
|
Explanation
|
Example
|
Logical AND ( && )
|
Friends is trah ke operators main jab dono hi variables ki value true
hoti hai to hi result hume true main milta hai otherwise result false hota
hai
|
a&&b
|
Logical OR ( || )
|
Friends is trah ke operators main jab dono variables main se kisi ek
ki bhi value true main aati hai to hume result true main hi milega.
|
a||b
|
Logical NOT ( ! )
|
Friends ye ek unary operator hota hai or dosto ye operator jis kisi
bhi variable ke saath use kiya jata hai us variable ki value ko ulta kar deta
hai.
|
!a
|
Relational Operators In Hindi
Friends ab hum baat karenge relational operators ki dosto is operator ka use hum jab karte hain jab hume kisi 2 variables ki beech main relation ka pta lagana ho jese ki vo dono variable equal hain ya 1 chhota hai or 1 bda hai, dosto inka use jadatar if statement main kiya jata hai. รจ
Operator
|
Explanation
|
Example
|
Equal to ( == )
|
Friends agar isme dono variables equal hote hain to result true hota
hai.
|
a==b
|
Not equal to ( != )
|
Friends agar isme dono variables ek dusre ke equal nhi hote hain to
result true return hota hai.
|
a!=b
|
Greater than ( > )
|
Friends agar isme left side ka variable right side ke variable se
bada hai to result true main hota hai.
|
a>b
|
Less than ( < )
|
Friends agar isme left side ka variable right side ke variable se
chhota hota hai to result true main hota hai.
|
a<b
|
Greater than equal to ( >= )
|
Friends agar isme left side ka variable right side ke variable se
bada hai ya uske barabar hai to result true main hoga.
|
a>=b
|
Less than equal to ( <= )
|
Friends agar isme left side ka variable right side ke variable se
chhota hai ya uske barabar ke to result true main hota hai.
|
a<=b
|
Assignment Operators In Hindi
Friends ab hum assignment operators ke bare main janenge dosto java assignment process ko easy or fast banane ke liye assignment operators provide karti hai. รจ
Operaor
|
Explanation
|
Example
|
Simple assignment ( = )
|
Friends ye operator right
variable ki value left variable ko assign karta hai.
|
a=b;
|
Plus assignment ( += )
|
Friends ye operator left or right variable ki value ko add karke
variable main store karta hai.
|
a+=b;
|
Minus assignment ( - = )
|
Friends ye operator left side ke variable ki value main se right side
ke variable ki value ko minus karke result left side ke variable main store
karta hai.
|
a-=b
|
Multiple assignment ( *= )
|
Friends ye operator left or right side ke variable ki value ko multiply
karke result left side ke variable main store karta hai.
|
a*=b
|
Divide assignment ( /= )
|
Friends ye operator left side ke variable ki value ko right side ke
variable se divide karke result left side ke variable main store karta hai.
|
a/=b
|
Arithmetic Operator In Hindi
Friends ab hum baat karte hain arithmetic operator ki dosto mathematical computation perform karne ke liye is operator ka use kiya jata hai, dosto ye operator 5 trah ke hote hain or vo operators hain รจ
Operator
|
Explanation
|
Example
|
Addition ( + )
|
Friends iska use 2 values ko add karne ke liye kiya jata hai.
|
a+b
|
Subtraction ( - )
|
Friends iska use ek value main se dusri value ko subtract karne ke
liye kiya jata hai.
|
a-b
|
Multiplication ( * )
|
Friends iska use 2 variables ki values ko multiply karne ke liye kiya
jata hai.
|
a*b
|
Division ( / )
|
Friends iska use kisi ek variable ke number ka dusre variable ke
number se divide karne ke liye kiya jata hai.
|
a/b
|
Moduls ( % )
|
Friends iska use jab kiya jata hai jab hum divide karne ke baad jo
sankhya bach jati hai or usko hum prapt karna chahte hain.
|
a%b
|
Conditional Operators ( :? ) In Hindi
Friends ab hum baat karte hain conditional operators ke bare main to dosto hum aapko bata de is operators vo operator hote hain jinko java main special operator bhi kaha jata hai dosto ye operators if statement ki trah kaam karte hain, or in operators ko ternary operator ke name se jante hain, dosto inka use variable main condition ke according values store karne ke liye hum karte hain. or dosto isme ? se pehle condition di jati hai agar vo condition true hai to colon se pehle ki value store ki jati hai or agar condition true nahi hoti hai to colon ke baad wali value ko variable main store kiya jata hai. for example รจa=5, b=3;
c=a>b?a:b; // c main a ki value store ki jayegi.
Bit Wise Operators In Hindi
Friends ab hum baat karte hain bit wise operators ki, dosto jab bhi bit by bit operation ko perform karna hota hai to is operator ka use karte hain, dosto ye operators variable ki value ko bits main convert karke un pe operation perform karti hai, dosto ye 4 trah ke hote hain or vo hain รจ
Operator
|
Explanation
|
Example
|
Bit wise AND ( & )
|
Friends ye operator jis 2 variables ke saath use kiya jata hai ye
unki common bits ko result variable ko copy karta hai.
|
a&b
|
Bit wise OR ( | )
|
Friends ye operator jis 2 variables ke saath use kiya jata hai ye
unki uncommon bits ko result variable ko copy karta hai.
|
a | b
|
Left shift ( << )
|
Friends is operator main kisi variable ki value bits main convert
karne ke baad uski bits ko left main shift karte hain.
|
a<<b
|
Right shift ( >> )
|
Friends is operator main kisi variable ki value bits main convert
karne ke baad uski bits ko right main shift karte hain.
|
a>>b
|
https://vladmihalcea.com/
ReplyDelete