💻 Step 9: Java Operators – 6th hour +code

Learn with our youtube video

💡Definition

-Set of symbols to perform specific operation.

💡Operators Categories-

Quick Overview of various operators in java-

OperatorDescriptionExample
+Addition5 + 2
-Subtraction5 - 2
*Multiplication5 * 2
/Division5 / 2
%Modulus (remainder)5 % 2
++Incrementi++
--Decrementi--
==Equal toa == b
!=Not equal toa != b
>Greater thana > b
<Less thana < b
>=Greater than or equal toa >= b
<=Less than or equal toa <= b
&&Logical anda && b
||Logical ora || b
!Logical not!a
instanceofDetermines if an object is an instance of a particular class or implements a particular interfaceobj instanceof MyClass
=Assignmenta = b
+=Addition assignmenta += b
-=Subtraction assignmenta -= b
*=Multiplication assignmenta *= b
/=Division assignmenta /= b
%=Modulus assignmenta %= b
? :Ternary (conditional) operatora ? b : c

💡1-Arithmetic and Assignment operators-

💡2-Relational operators-

💡3-Logical operators –

logical operators1


ao13

💡4-Misc operators ( ?: (if-else-then), instanceof)

ao15

 

Interview Questions —

  • What is difference between arithmetic and relational operators
  • What is instanceOf operator?

Leave a Reply

Your email address will not be published. Required fields are marked *