SlideShare a Scribd company logo
1 of 14
Presentation by-
OPERATOR
 It is a special symbols performing specific
operations on one, two or three operands and
then returning a result.
Java provides a rich set of operators to
manipulate variables
Kunal
Operands
An operand is the quantity on which an operation is to be done..
 An operand can be:
o A numeric variable - integer, floating point or
character
O Any primitive type variable - numeric and Boolean.
o Reference variable to an object
o A literal - numeric value, Boolean value, or string.
o An array element, "a[2]“
o char primitive, which in numeric operations is
treated as an unsigned two byte integer
Kunal
TYPES OF OPERATORS
1. Assignment Operators
2. Increment Decrement Operators
3. Arithmetic Operators
4. Bitwise Operators
5. Relational Operators
6. Logical Operators
7. Ternary Operators
8. Shift Operator
9. Instance of Operators
Kunal
ASSIGNMENT OPERATORS
An assignment operator is the operator used to assign a new value
to a variable
 The assignment statements has the following syntax:
<variable> = <expression>
for ex:
int a, b;
a=2; // 2 is assigned to variable a
b=3; // 3 is assigned to variable b
Kunal
INCREMENT AND DECREMENT OPERATORS
++ AND --
Increment (++) and decrement (--) operators in Java programming
lets us easily add 1 to, or subtract 1 from, a variable. For example,
using increment operators, you can add 1 to a variable named a like
this: a++; An expression that uses an increment or decrement operator
is a statement itself.
 two successive plus signs, ++
 decrement operator: --
for example:
a=a+1;
b=b+1;
a++ ; or ++a ;
b-- ; or –b ;
Kunal
ARITHMETIC OPERATORS
 The arithmetic operators are used to construct
mathematical expressions as in algebra.
 Their operands are of numeric type.
Example of arithmetic operators are;
+ , - , * , / , etc
Kunal
BITWISE OPERATORS
 A bitwise operation operates on one or more
bit patterns or binary numerals at the level of
their individual bits.
 If an operand is shorter than an int, it is
promoted to int before
doing the operations.
for example ::
& ,| , ^ ,~ , << , >> , >>>
Kunal
RELATIONAL OPERATORS
 A relational operator compares two values
and determines the
relationship between them.
 For example, != returns true if its two
operands are unequal.
 Relational operators are used to test whether
two values are
equal, whether one value is greater than
another, and so
forth.
for example:
== , != , > , >= , <=
Kunal
LOGICAL OPERATORS
A logical operator (sometimes called a
“Boolean operator”) in Java programming is an
operator that returns a Boolean result that's
based on the Boolean result of one or two other
expressions
 for example:
&& , || , !
Kunal
TERNARY OPERATORS
This operator consists of three operands and is
used to evaluate Boolean expressions. The goal of
the operator is to decide; which value should be
assigned to the variable.
 Unlike the if statement, the conditional
operator is an
expression which can be used for
example of ternary operator:
int answer;
if ( a > b )
{
answer = 1;
}
else
{
answer = -1;
}
Shift operators
The shift operators, << (shift left), and >> (shift
right), take two integers as operands. They
return the result of shifting the bits of the left
operand by the number of positions specified by
the right operand. The left shift operator shifts
bits to the left, and the right shift operator shifts
bits to the right.
INSTANCE OF OPERATORS
 This operator is used only for object reference
variables. The
operator checks whether the object is of a
particular type(class
type or interface type).
Instance Of operator is written as:
( Object reference variable ) instance Of
(class/interface type)
Kunal
A REFRENCEVARIABLE ISAVARIABLEWHICH IS DEC LARED FOR SPECIFICTYPE
ANDWHOSETYPE IS NEVERGONNA CHANGE
Thank you
Kunal

More Related Content

What's hot

Operators and Expressions in Java
Operators and Expressions in JavaOperators and Expressions in Java
Operators and Expressions in Java
Abhilash Nair
 

What's hot (20)

Java data types, variables and jvm
Java data types, variables and jvm Java data types, variables and jvm
Java data types, variables and jvm
 
Control Statements in Java
Control Statements in JavaControl Statements in Java
Control Statements in Java
 
Operators and expressions in C++
Operators and expressions in C++Operators and expressions in C++
Operators and expressions in C++
 
Conditionalstatement
ConditionalstatementConditionalstatement
Conditionalstatement
 
Java Data Types
Java Data TypesJava Data Types
Java Data Types
 
Operators and Expressions in Java
Operators and Expressions in JavaOperators and Expressions in Java
Operators and Expressions in Java
 
Operator in c programming
Operator in c programmingOperator in c programming
Operator in c programming
 
Python Sequence | Python Lists | Python Sets & Dictionary | Python Strings | ...
Python Sequence | Python Lists | Python Sets & Dictionary | Python Strings | ...Python Sequence | Python Lists | Python Sets & Dictionary | Python Strings | ...
Python Sequence | Python Lists | Python Sets & Dictionary | Python Strings | ...
 
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
 
Python strings presentation
Python strings presentationPython strings presentation
Python strings presentation
 
Features of java
Features of javaFeatures of java
Features of java
 
Java tutorial PPT
Java tutorial PPTJava tutorial PPT
Java tutorial PPT
 
Conditional and control statement
Conditional and control statementConditional and control statement
Conditional and control statement
 
Operators in java
Operators in javaOperators in java
Operators in java
 
Vectors in Java
Vectors in JavaVectors in Java
Vectors in Java
 
Basics of JAVA programming
Basics of JAVA programmingBasics of JAVA programming
Basics of JAVA programming
 
Loops in Python
Loops in PythonLoops in Python
Loops in Python
 
python conditional statement.pptx
python conditional statement.pptxpython conditional statement.pptx
python conditional statement.pptx
 
Presentation on-exception-handling
Presentation on-exception-handlingPresentation on-exception-handling
Presentation on-exception-handling
 
RECURSION IN C
RECURSION IN C RECURSION IN C
RECURSION IN C
 

Similar to Operators in java presentation

Similar to Operators in java presentation (20)

Opeartor &amp; expression
Opeartor &amp; expressionOpeartor &amp; expression
Opeartor &amp; expression
 
Types of Operators in C
Types of Operators in CTypes of Operators in C
Types of Operators in C
 
Operators used in vb.net
Operators used in vb.netOperators used in vb.net
Operators used in vb.net
 
4_A1208223655_21789_2_2018_04. Operators.ppt
4_A1208223655_21789_2_2018_04. Operators.ppt4_A1208223655_21789_2_2018_04. Operators.ppt
4_A1208223655_21789_2_2018_04. Operators.ppt
 
Operators in Python
Operators in PythonOperators in Python
Operators in Python
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unit
 
C# operators
C# operatorsC# operators
C# operators
 
Operators in c++
Operators in c++Operators in c++
Operators in c++
 
operators and expressions in c++
 operators and expressions in c++ operators and expressions in c++
operators and expressions in c++
 
Java basic operators
Java basic operatorsJava basic operators
Java basic operators
 
Java basic operators
Java basic operatorsJava basic operators
Java basic operators
 
Java Operators.ppt
Java Operators.pptJava Operators.ppt
Java Operators.ppt
 
Operator 04 (js)
Operator 04 (js)Operator 04 (js)
Operator 04 (js)
 
Coper in C
Coper in CCoper in C
Coper in C
 
OCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & StatementsOCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & Statements
 
python operators.ppt
python operators.pptpython operators.ppt
python operators.ppt
 
Py-Slides-2 (1).ppt
Py-Slides-2 (1).pptPy-Slides-2 (1).ppt
Py-Slides-2 (1).ppt
 
Py-Slides-2.ppt
Py-Slides-2.pptPy-Slides-2.ppt
Py-Slides-2.ppt
 
Py-Slides-2.ppt
Py-Slides-2.pptPy-Slides-2.ppt
Py-Slides-2.ppt
 
operators in c++
operators in c++operators in c++
operators in c++
 

More from kunal kishore (6)

Feasibility study ppt
Feasibility study pptFeasibility study ppt
Feasibility study ppt
 
constructors in java ppt
constructors in java pptconstructors in java ppt
constructors in java ppt
 
Elements of system ppt
Elements of system pptElements of system ppt
Elements of system ppt
 
Tools of structured analysis presentation
Tools of structured analysis presentationTools of structured analysis presentation
Tools of structured analysis presentation
 
Probability presentation
Probability presentationProbability presentation
Probability presentation
 
K-MAP(KARNAUGH MAP)BY THE SILENT PROGRAMMER
K-MAP(KARNAUGH MAP)BY THE SILENT PROGRAMMERK-MAP(KARNAUGH MAP)BY THE SILENT PROGRAMMER
K-MAP(KARNAUGH MAP)BY THE SILENT PROGRAMMER
 

Recently uploaded

Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
EADTU
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
httgc7rh9c
 

Recently uploaded (20)

Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Our Environment Class 10 Science Notes pdf
Our Environment Class 10 Science Notes pdfOur Environment Class 10 Science Notes pdf
Our Environment Class 10 Science Notes pdf
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 

Operators in java presentation

  • 2. OPERATOR  It is a special symbols performing specific operations on one, two or three operands and then returning a result. Java provides a rich set of operators to manipulate variables Kunal
  • 3. Operands An operand is the quantity on which an operation is to be done..  An operand can be: o A numeric variable - integer, floating point or character O Any primitive type variable - numeric and Boolean. o Reference variable to an object o A literal - numeric value, Boolean value, or string. o An array element, "a[2]“ o char primitive, which in numeric operations is treated as an unsigned two byte integer Kunal
  • 4. TYPES OF OPERATORS 1. Assignment Operators 2. Increment Decrement Operators 3. Arithmetic Operators 4. Bitwise Operators 5. Relational Operators 6. Logical Operators 7. Ternary Operators 8. Shift Operator 9. Instance of Operators Kunal
  • 5. ASSIGNMENT OPERATORS An assignment operator is the operator used to assign a new value to a variable  The assignment statements has the following syntax: <variable> = <expression> for ex: int a, b; a=2; // 2 is assigned to variable a b=3; // 3 is assigned to variable b Kunal
  • 6. INCREMENT AND DECREMENT OPERATORS ++ AND -- Increment (++) and decrement (--) operators in Java programming lets us easily add 1 to, or subtract 1 from, a variable. For example, using increment operators, you can add 1 to a variable named a like this: a++; An expression that uses an increment or decrement operator is a statement itself.  two successive plus signs, ++  decrement operator: -- for example: a=a+1; b=b+1; a++ ; or ++a ; b-- ; or –b ; Kunal
  • 7. ARITHMETIC OPERATORS  The arithmetic operators are used to construct mathematical expressions as in algebra.  Their operands are of numeric type. Example of arithmetic operators are; + , - , * , / , etc Kunal
  • 8. BITWISE OPERATORS  A bitwise operation operates on one or more bit patterns or binary numerals at the level of their individual bits.  If an operand is shorter than an int, it is promoted to int before doing the operations. for example :: & ,| , ^ ,~ , << , >> , >>> Kunal
  • 9. RELATIONAL OPERATORS  A relational operator compares two values and determines the relationship between them.  For example, != returns true if its two operands are unequal.  Relational operators are used to test whether two values are equal, whether one value is greater than another, and so forth. for example: == , != , > , >= , <= Kunal
  • 10. LOGICAL OPERATORS A logical operator (sometimes called a “Boolean operator”) in Java programming is an operator that returns a Boolean result that's based on the Boolean result of one or two other expressions  for example: && , || , ! Kunal
  • 11. TERNARY OPERATORS This operator consists of three operands and is used to evaluate Boolean expressions. The goal of the operator is to decide; which value should be assigned to the variable.  Unlike the if statement, the conditional operator is an expression which can be used for example of ternary operator: int answer; if ( a > b ) { answer = 1; } else { answer = -1; }
  • 12. Shift operators The shift operators, << (shift left), and >> (shift right), take two integers as operands. They return the result of shifting the bits of the left operand by the number of positions specified by the right operand. The left shift operator shifts bits to the left, and the right shift operator shifts bits to the right.
  • 13. INSTANCE OF OPERATORS  This operator is used only for object reference variables. The operator checks whether the object is of a particular type(class type or interface type). Instance Of operator is written as: ( Object reference variable ) instance Of (class/interface type) Kunal A REFRENCEVARIABLE ISAVARIABLEWHICH IS DEC LARED FOR SPECIFICTYPE ANDWHOSETYPE IS NEVERGONNA CHANGE