homecode zoneQuick Codedownloadssubmit codeabout usfeedbackscontact ussitemap
 
Concepts
Constant Varibles & Data Types
Operators
Pro - Languages
C/C++
Java
Visual basic
asp
vb.net 2003/2005
asp.net
Quick Code
SUBMIT CODE
Mail List
LINKS
LINK TO US
Submit LINK
 
ProgrammerGuide.net - Java Operators.
Home » Java Zone » Operators

Introduction

Java supports a rich set of operators, such as =, +, -, * and /. Operators are used in program to manipulate data and variables. They usually form a part of mathematical or logical expression.

Java operators can be classified into a number of related categories as below:

  1. Arithmetic Operators
  2. Relational Operators
  3. Logical Operators
  4. Assignment Operators
  5. Increment and Decrement Operators
  6. Conditional Operators
  7. Bitwise Operators
  8. Special Operators

Arithmetic operator

Java provides all basic arithmetic operators. These can be operated in a build-in numeric data type of java. We cannot use this operator in Boolean types. List of arithmetic operators are as follows:

Operators Meaning
+ Addition and unary plus
- Subtraction and unary minus
* Multiplication
/ Division
% Modulo division

Relational Operators

We often compare two quantities, and depending on their relation, take certain decision. We have already used the symbol ‘<’, meaning ‘less than’. An expression such as

a < b    or    x < 20

Containing a relational operator is termed as a relational expression. The value of a relational expression is either true or false. For example if x = 10, then

x < 20   is   true

20 < x   is   false

Java supports six relational operators in all. These operators and their meaning are given below:

Operators Meaning
< is less than
<= is less than or equal to
> is greater than
>= s greater than or equal to
= = is equal to
!= is not equal to

Logical operators

In addition to relational operator, Java has three logical operators, which are given below:



« Previous 1 2 3 Next »

Viewers: 15
Visitors:127291
Last Updated on:Sunday, January 17, 2010
Home | About us | Feedback | Contact us | Sitemap
Copyright © 2008 ProgrammerGuide.net. All rights reserved.
This site is best viewed in IE 6.0, Firefox 1.5 and above with screen resolution of 1024 X 768.