The Artima Developer Community
Sponsored Link

Java Buzz Forum
Basic operators in java

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
instanceof java

Posts: 576
Nickname: instanceof
Registered: Jan, 2015

instanceof java is a java related one.
Basic operators in java Posted: Mar 22, 2016 9:49 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by instanceof java.
Original Post: Basic operators in java
Feed Title: Instance Of Java
Feed URL: http://feeds.feedburner.com/blogspot/TXghwE
Feed Description: Instance of Java. A place where you can learn java in simple way each and every topic covered with many points and sample programs.
Latest Java Buzz Posts
Latest Java Buzz Posts by instanceof java
Latest Posts From Instance Of Java

Advertisement
Types of Operators in Java:

  1. Arithmetic Operators
  2. Bit-wise Operators
  3. Logical Operators
  4. Relational Operators 
  5. Assignment Operators
  6. Misc Operators



Java operator precedence

java order of operations

Arithmetic Operators
  • Arithmetic operators are used in mathematical expressions.
  • Following are the arithmetic operators in java.
  1. +  :  Addition
  2. -   : Subtraction
  3. *  : Multiplication
  4. /   : Division
  5. % : Modulus

Bit wise Operators:

  • Bit wise operators operates on individual bits of operands.
  • Following are the Bit-wise operators in java.

  1. ~      : Bit wise unary not
  2. &     : Bit wise And
  3. |       : Bit wise OR
  4. ^      : Bit wise Exclusive OR
  5. >>    : Shift Right
  6. >>>  : Shift right zero fill
  7. <<    :Shift left

Logical Operators:

  1. && : Logical AND
  2. ||      : Logical OR
  3. !      : Logical NOT

Relational Operators in java

  1. ==  : Equal to
  2. !=   : Not Equal to
  3. <    : Less Than
  4. >    : Greater Than
  5. >=  : Greater Than or Equal to
  6. <= : Less Than or Equal to

Assignment Operators:

  1. =    : Simple Assignment
  2. +=  : Add and assign
  3. -=   : Subtract and assign
  4. *=   : Multiply and assign
  5. %=  : Modulus and assign
  6. /=    : Divide and assign
  7. &=   : Bit wise AND assignment
  8. |=     : Bit wise assignment OR
  9. ^=    : Bit wise Exclusive OR assignment
  10. >>= : Shift Right assignment
  11. >>>= : Shift right  zero fill assignment
  12. <<=   : Shift left assignment


Misc Operators:

Increment and Decrement operators:
  1. ++ : increment
  2. --   : decrement


Conditional Operator: (?:)

  • Also known as ternary operator
  • Example: int a= 1>2?1:2;


Instanceof Operator
  • Instance of operator is used to test whether that object is belong to that class type or not.
  • If that object belongs to that class it returns true .otherwise it returns false.
  • Instance of operator is also known as comparison operator.because it compares with the instance of type.
Instanceof operator in java

Read: Basic operators in java

Topic: JavaFX Drag and Drop Example Previous Topic   Next Topic Topic: Java Runnable vs Callable

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use