Java Operators

Ads
 
Tutorials   
What are the prerequisites for learning Java? How to replace all occurrences of a string in JavaScript? How to convert a stack trace to a string? Example code of reading file line by line in Java with Apache Commons IO library How to store unique values in Java using Set? java.nio ShortBuffer Example How to use Java Path class? Java NIO Package Tutorial How to limit object creation in Java? Java 11 String lines function example to split it in lines Top upcoming features of JDK 11 Java/JDK 11 Tutorial How to install JDK 10 in Ubuntu 18.04? Install JDK 10 on Windows Java 10 features Processing large file in Java Learning Java for non programmers Why You Should Learn Java in 2018? Installing JDK 9 on Windows 10 How to convert binary to decimal in Java? How to add two numbers in Java? What is Applet in Java with Example? What is nested class in Java with Example? Exception handling in Java Programming Examples What is Constructor Overloading in Java? How to display image in Swing? What is Java programming used for? How to create custom exception in Java? How to set CLASSPATH in Java? What is Multithreading in Java? IO Streams in Java with Examples How to convert String Date to Timestamp in Java? Best Java Tutorial for Beginners Read user input in Java using Scanner Java Programming Examples Read file line by line in Java 8 What are the benefits of learning Java Programming? A brief history and future of Java programming language Importance of Java for Mobile Application Development How To Become A Good Software Developer?

Java Operators

Assignment operator is the most common operator almost used with all programming languages.

Assignment operator is the most common operator almost used with all programming languages.

Java Operators

     

  1. Simple Assignment Operator
    Assignment operator is the most common operator almost used with all programming languages.
        
  2. Arithmetic Operators
    Arithmetic Operators are used to perform some mathematical operations like addition, subtraction, multiplication, division, and modulo (or remainder).
      
  3. Unary Operators
    The unary operators requires only one operand to perform different kind of operations such as increasing/decreasing a value, negating an expression, or inverting a boolean value.
      
  4. Equality and Relational Operators
    Whenever we need to compare the results of two expressions or operands in a program then the equality and relational operators are used to know whether an operand is equal, not equal, greater than, less than to another operand.
       
  5. Conditional (Logical) Operators
    Conditional operators return a true or a false value based on the state of the variables i.e. the operations using conditional operators are performed between the two boolean expressions. 
      
  6. Bitwise and Bit Shift Operators
    In Java the bitwise and bit shift operators are used to manipulate the contents of variables at a bit level according to binary format.
      
  7. Type Operators
    Java provides a run-time operator instanceof to compare a class and an instance of that class. This operator " instanceof" compares an object to a specified class type
      
  8. Operator Precedence
    In Java, Operator Precedence is an evaluation order in which the operators within an expression are evaluated on the priority bases.
     

Ads

Ads