Home Jsp Simple-jsp-example Using Operators in JSP
Questions:Ask|Latest


 
 

Share on Google+Share on Google+

Using Operators in JSP

Advertisement
In mathematics, an operator is a function, usually of a special kind depending on the topic.

Using Operators in JSP

        

In mathematics, an operator is a function, usually of a special kind depending on the topic. An operator is a function that acts on functions to produce other functions. A operator symbol or operator name is a notation that denotes a particular operator. 

There are many types of operators.

 

  1. postfix operator      var++, var--
  2. unary     ++var, --var, +var, -var,  ! ,
  3. multiplicative    *, /, %
  4. additive       +, -
  5. shift       <<, >>, >>>
  6. relational      < >, <=, >=, instanceof
  7. equality         = =, !=
  8. bitwise AND     &
  9. logical AND        &&
  10. logical OR       | |
  11. bitwise exclusive OR      ^
  12. bitwise inclusive OR        |
  13.  ternary      ?, :
  14. assignment       =, +=, -=, /=, *=, %=, ^=, |=, <<=, >>=, >>>=

 

The code of the program is given below:

<HTML>
  <HEAD>
    <TITLE>Using Operators in Jsp</TITLE>
  </HEAD>
  <BODY>
  <table border="1" align="center">
  <tr><td>
    <H1>Using Operators in Jsp</H1>
    <%
        int Operator1 = 23, operartor2 = 40, SumOper;
       SumOper = Operator1 + operartor2 ;
        out.println(Operator1 + " + " +  operartor2 +
            " = " + SumOper);
     %></tr></td>
	 <BR><BR> <tr><td>
	 <%
        int Operator3 = 3, operartor4 = 4, MulOper;
       MulOper = Operator1 * operartor2 ;
        out.println(Operator1 + " * " +  operartor2 +
            " = " + MulOper);
     %></tr></td>
</table>
  </BODY>
</HTML>

 

Output of the Program:

 

Download this example.

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: February 11, 2008

Ask Questions?    Discuss: Using Operators in JSP  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
DMCA.com