Address
:
[go:
up one dir
,
main page
]
Include Form
Remove Scripts
Session Cookies
Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
11 views
5 pages
Operators
Uploaded by
SRIHARI RAMESH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save Operators For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
11 views
5 pages
Operators
Uploaded by
SRIHARI RAMESH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save Operators For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 5
Search
Fullscreen
19/23, 10007 PM Java Tutoviak: Operators, Types of Operators & Expressions in Java | CodsWithHarry CodeWithHarry Menu & t Java Tutorial: Operators, Types of Operators & Exor... Show Course Contents © Overview Q&A Downloads Announcements < Java Tutorial: Operators, Types of Operators & Expressions in Java * An operator is a symbol that the compiler to perform a specific operation on operands. * Example: atb=c * In the above example, 'a’ and 'b' are operands on which the’ operator is applied. Types of operators : 1. Arithmetic Operators : Arithmetic operators are used to perform mathematical operations such as addition, division, etc on expressions. Arithmetic operators cannot work with Booleans. % operator can work on floats and doubles. Let x=7 and y=2 ae Exampl Operator Description hitps:lwwn-codewithharry.comvideos/java-utorialsfor-beginners-8)19/23, 10007 PM Java Tutoviak: Operators, Types of Operators & Expressions in Java | CodsWithHarry x+y= + (Addition) Used to add two numbers 9 y : Used to subtract the right-hand side value from the 5 x-y= (Subtraction) left-hand side value y x*ys (Multiplicatio Used to multiply two values. 4 n) x/y= / (Division) Used to divide left-hand Value by right-hand value. 3 Used to print the remainder after dividing the left-hand x%y= % (Modulus) side value from 1 the right-hand side value. 4 Increases the value of operand by 1. xt = 8 (Increment) Decreases the value of operand by 1. (Decrement) 2. Comparison Operators : * As the name suggests, these operators are used to compare two operands. * Let x=7 and y=2 Operator Description Example Checks if two operands (Equal are equal. Returns a y--> False to) boolean value. Checks if two operands != (Not are not equal. Returns x != y --> True equal a boolean value. Checks if the left-hand > side value is greater (Greater than the right-hand =x > y--> True than) side value. Returns a boolean value. <(Less Checks if the left-hand x < y--> False than) __ side value is smaller than the right-hand hitps:lwwn-codewithharry.comvideos/java-utorialsfor-beginners-8) 215‘80023, 1007 PM Java Tula: Operator, Types of Operators & Expressions in Java| CodelithHarry side value. Returns a boolean value. Checks if the left-hand >= side value is greater (Greater than or equal to the x >=y--> True than or right-hand side value. equal to) Returns a boolean value. Checks if the left-hand side value is less than <= (Less : or equal to the right- than or . x <= y-->False hand side value. equal to) Returns a boolean value. 3. Logical Operators : * These operators determine the logic in an expression containing two or more values or variables. © Letx=8andy=2 Bk | xy && Returns true if both operands (logical xley—-> are true. and) True Il x
operand is true. on) True Returns true if the result of the (x
not) versa False 4. Bitwise Operators : * These operators perform the operations on every bit of a number. * Let x =2 and y=3. So 2 in binary is 100, and 3 is ON. Operat age or Description Example & 181 =1, 0&1=0,1&0=0,1&1=1, 0&0 =0 (A & B) = (100 & O11) = 000 (bitwis hitps:lwwn-codewithharry.comvideos/java-utorialsfor-beginners-8) 3519/23, 10007 PM Java Tutoviak: Operators, Types of Operators & Expressions in Java | CodsWithHarry e and) | (bitwis 1&0 =1, 0&1=1,1&1=1, O&0=0 (Al B) = (100 | on) = 111 eor) (bitwis 1&0 =1, 0&1=1,1&1=0, 0&0=0 (A*B) = (1004011) = 11 e XOR) << (left This operator moves the value left by . 13<<2 = 52(decimal) shift) the number of bits specified. > (right shift) This operator moves the value left by . 13>>2 = 3(decimal) the number of bits specified. Precedence of operators The operators are applied and evaluated based on precedence. For example, (+,-) has less precedence compared to (*, /). Hence * and / are evaluated first. In case we like to change this order, we use parenthesis (). Code as Described in the Video package public class CWH_Ch2_Operators public static void main(String // 1, Arithmetic Operators int 4 // int b = 6 % a; // Modulo Operator // 4,8%1,1 --> Returns Decimal Remainder // 2, Assignment Operators int 9 3 system println // 3. Comparison Operators // System,out.print1n(64<6) ; // 4, Logical Operators hitps:lwwn-codewithharry.comvideos/java-utorialsfor-beginners-8) 45923, 1007 Java Tura Operators, Types of Operators & Expressions in ava | CodeWihiany // System.out.print1n(64>5 && 64>98); System.out.print1n(64>5 || 64>98); // 5. Bitwise Operators System, out.print1n(2&3) ; MW 10 M7 11 W oo / 10 Handwritten Notes: Click To Download Ultimate Java Cheatsheet: Click To Download Previous Next A 8 CodeWithHarry Copyright © 2022 CodeWithHarry.com #¥O090 hips slw.codewithharry.comivideos/java-tutorialsfor-beginners-8! 55
You might also like
Operators
PDF
No ratings yet
Operators
28 pages
Operator-in-Java 7
PDF
No ratings yet
Operator-in-Java 7
11 pages
Java Statements and Operators
PDF
No ratings yet
Java Statements and Operators
39 pages
JAVA Notes
PDF
No ratings yet
JAVA Notes
63 pages
Unit1 Part2
PDF
No ratings yet
Unit1 Part2
57 pages
Operators in Java
PDF
No ratings yet
Operators in Java
23 pages
Lecture 6
PDF
No ratings yet
Lecture 6
23 pages
#20 Operators
PDF
No ratings yet
#20 Operators
11 pages
Chapter 4 - Operator and Expression in Java
PDF
No ratings yet
Chapter 4 - Operator and Expression in Java
30 pages
3 Basic I - O, Operators 16-07-2024
PDF
No ratings yet
3 Basic I - O, Operators 16-07-2024
41 pages
Lecture - 3
PDF
No ratings yet
Lecture - 3
19 pages
1 3 0 P 603c5d2fdf277 File
PDF
No ratings yet
1 3 0 P 603c5d2fdf277 File
31 pages
Chapter 4
PDF
No ratings yet
Chapter 4
37 pages
Topic 4 - Operators in Java
PDF
No ratings yet
Topic 4 - Operators in Java
10 pages
4.1 Operators Operands Expressions 2
PDF
No ratings yet
4.1 Operators Operands Expressions 2
26 pages
L03 - Operators
PDF
No ratings yet
L03 - Operators
19 pages
5.2 Operators in Java
PDF
No ratings yet
5.2 Operators in Java
10 pages
Operators in Java With Examples
PDF
No ratings yet
Operators in Java With Examples
7 pages
Module 2
PDF
No ratings yet
Module 2
15 pages
01 5 Operators
PDF
No ratings yet
01 5 Operators
16 pages
A990689351 - 21789 - 9 - 2019 - 04. Operators
PDF
No ratings yet
A990689351 - 21789 - 9 - 2019 - 04. Operators
45 pages
OOP CS3391 UNIT-1 (Lecture Note-13)
PDF
No ratings yet
OOP CS3391 UNIT-1 (Lecture Note-13)
16 pages
Acharya Parambarai
PDF
No ratings yet
Acharya Parambarai
6 pages
Operator's and Expressions
PDF
No ratings yet
Operator's and Expressions
36 pages
05.java Operators
PDF
No ratings yet
05.java Operators
12 pages
Java Bca4 Solution
PDF
No ratings yet
Java Bca4 Solution
45 pages
Operators
PDF
No ratings yet
Operators
23 pages
Java Operators
PDF
No ratings yet
Java Operators
30 pages
Operator & Control Statements
PDF
No ratings yet
Operator & Control Statements
7 pages
Chapter 5
PDF
No ratings yet
Chapter 5
44 pages
Operators (Autosaved)
PDF
No ratings yet
Operators (Autosaved)
27 pages
Java Operators
PDF
No ratings yet
Java Operators
11 pages
Mod 1 Part2
PDF
No ratings yet
Mod 1 Part2
7 pages
Introduction To Java Operators
PDF
No ratings yet
Introduction To Java Operators
8 pages
Chapter 002 (Arithmetic, Assignment, Comparison, Logical) - Operators, String Concatenation
PDF
No ratings yet
Chapter 002 (Arithmetic, Assignment, Comparison, Logical) - Operators, String Concatenation
9 pages
Pi
PDF
No ratings yet
Pi
9 pages
Operators
PDF
No ratings yet
Operators
6 pages
Operators in Java
PDF
No ratings yet
Operators in Java
10 pages
Java Operator Precedence
PDF
No ratings yet
Java Operator Precedence
23 pages
OOP Lec 4
PDF
No ratings yet
OOP Lec 4
15 pages
Operators in Java
PDF
No ratings yet
Operators in Java
9 pages
Lab04 - Introduction To Operators
PDF
No ratings yet
Lab04 - Introduction To Operators
4 pages
Dp4 Java Operators
PDF
No ratings yet
Dp4 Java Operators
29 pages
2.3 Operators in Java1
PDF
No ratings yet
2.3 Operators in Java1
5 pages
Operators in Java
PDF
No ratings yet
Operators in Java
9 pages
ClassXI OPERATORS&EXPRESSIONS (Ch06)
PDF
No ratings yet
ClassXI OPERATORS&EXPRESSIONS (Ch06)
7 pages
UNIT-I (Operators)
PDF
No ratings yet
UNIT-I (Operators)
21 pages
Java Operators: General
PDF
No ratings yet
Java Operators: General
20 pages
Module 1 - Chapter 3-Operators
PDF
No ratings yet
Module 1 - Chapter 3-Operators
12 pages
Operators in Java - Javatpoint
PDF
No ratings yet
Operators in Java - Javatpoint
18 pages
Chapter 3 - Java Basic Operators
PDF
No ratings yet
Chapter 3 - Java Basic Operators
7 pages
Operators in Java
PDF
No ratings yet
Operators in Java
17 pages
Week 013-014 Module Java Operators
PDF
No ratings yet
Week 013-014 Module Java Operators
9 pages
Operators in Java
PDF
No ratings yet
Operators in Java
13 pages
Java Opertors
PDF
No ratings yet
Java Opertors
20 pages
Presentation Java Operators 2012 Final
PDF
No ratings yet
Presentation Java Operators 2012 Final
27 pages
Operators in Java
PDF
No ratings yet
Operators in Java
11 pages
Show Examples: Operator Description Example
PDF
No ratings yet
Show Examples: Operator Description Example
6 pages
Lecture 07 - Java Operators
PDF
No ratings yet
Lecture 07 - Java Operators
3 pages