Java
  Home arrow Java arrow Java Operators
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVA

Java Operators
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 11
    2007-10-22


    Table of Contents:
  • Java Operators
  • Assignment Operators
  • Doing More Math with Assignment Operators
  • Forming a Relationship with Operators

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Java Operators
    ( Page 1 of 4 )

    It's been about a month or so since we finished our beginning Java series, so I'm sure you're ready for more. This time, I am going to teach you to work with operators in Java. When I am finished, you will be able to do complex mathematical equations, add one string of text to another, and build programs so powerful you will be able to put thousands of hard working Americans out of work with the push of a button.

    So look out global economy, here we come.

    Operators

    There used to be a time when you called "Information" on the phone and you heard a real, honest-to-goodness voice. All that is done with. Now you talk to a computer, and the funny thing about computers is that they have no ears. So when I call up and, for example, ask for the number to Annie's Pizza, it's little surprise that the “operator” comes back to me with the number to Danny's Pizza, no matter how much emphasis I place on the A in Annie.

    Unlike modern computer operators, Java Operators aren't annoying, and like the phone operators of old, are actually helpful. You have used operators your entire life, and their function is simple: they allow you to manipulate data. And let's face it, what good is data if you can't manipulate it?

    There are several types of operators, but before we go into them, you should understand a little thing we in the biz call operator precedence. Precedence determines in which order operators execute. If that's not clear, it will be in a few moments.

    But first, look at this beautiful table designed by yours truly:


    Operator Type

    Operator Precedence

    postfix

    expr++ expr--

    unary

    ++expr –expr +expr -expr ~ !

    multiplicative

    * / %

    additive

    + -

    shift

    << >> >>>

    relational

    < > <= >= instanceof

    equality

    “==” !=

    bitwise AND

    &

    bitwise exclusive OR

    ^

    bitwise inclusive OR

    |

    logical AND

    &&

    logical OR

    ||

    ternary

    ? :

    assignment

    “=” += -= *= /= %= &= ^= |= <<= >>= >>>=

    The above table lists the operators and their precedence in order.



     
     
    >>> More Java Articles          >>> More By James Payne
     

       

    JAVA ARTICLES

    - Exception Handling Techniques in Java
    - More About Multithreading in Java
    - The Basics of Multiple Threads in Java
    - Data Access Using Spring Framework JDBC
    - New Object Initialization in Java
    - Adding Images With iTextSharp
    - Adding Columns With iTextSharp
    - Creating Simple PDF Files With iTextSharp
    - The Spring Framework: Understanding IoC
    - Introducing the Spring Framework
    - Java Classes
    - Completing the Syntactic Comparison of Java ...
    - Syntactic Comparison of Java and C/C++
    - Java Statements
    - Conditionals, Expressions and Other Java Ope...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    Stay green...Green IT