%@ page import="java.util.*" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/ea/core" %>
JSTL: EcmaScript EL Support -- Bitwise Operator Example
Bitwise Operators
The Bitwise operators perform boolean algebra on the individual bits of the operands or shift bits left and right. It is used to manipulate the binary numbers and binary representation of decimal integers. The operators return Nan if the operands are not integers or are too large to fit in a 32-bit integer representation.
Here are some examples:
<% request.setAttribute("a", new Integer(13)); %>
<% request.setAttribute("b", new Integer(1)); %>
<% request.setAttribute("c", new Integer(0)); %>
Operator: & (Bitwise And)
Operator: | (Bitwise Or)
Operator: ^ (Bitwise Xor)
Operator: ~ (Bitwise Not)
Operator: << (Shift Left)
Operator: >> (Shift Right with Sign)
Operator: >>> (Shift Right Zero Fill)