<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java_Tutorial%2FOperators%2FOperators</id>
		<title>Java Tutorial/Operators/Operators - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java_Tutorial%2FOperators%2FOperators"/>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java_Tutorial/Operators/Operators&amp;action=history"/>
		<updated>2026-04-23T23:56:22Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java_Tutorial/Operators/Operators&amp;diff=4051&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java_Tutorial/Operators/Operators&amp;diff=4051&amp;oldid=prev"/>
				<updated>2010-06-01T04:57:52Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 04:57, 1 июня 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java_Tutorial/Operators/Operators&amp;diff=4050&amp;oldid=prev</id>
		<title> в 17:44, 31 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java_Tutorial/Operators/Operators&amp;diff=4050&amp;oldid=prev"/>
				<updated>2010-05-31T17:44:27Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==  Operator Precedence ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Operators with a higher precedence are executed before those of a lower precedence.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Operators on the same line have the same precedence:&amp;lt;/p&amp;gt;&lt;br /&gt;
Operator Precedence GroupAssociativityOperator Precedence(), [], postfix ++, postfix --leftHighestunary +, unary -, prefix ++, prefix --, ~, !right(type), newleft*, /, %left+, -left&amp;lt;&amp;lt;, &amp;gt;&amp;gt;, &amp;gt;&amp;gt;&amp;gt;left&amp;lt; ,&amp;lt;= , &amp;gt;, &amp;gt;=, instanceof==, !=&amp;amp;left^left|left&amp;amp;&amp;amp;left||left?:left=, +=, -=, *=, /=, %=, &amp;lt;&amp;lt;=, &amp;gt;&amp;gt;=, &amp;gt;&amp;gt;&amp;gt;=, &amp;amp;=, |=, ^=rightlowest&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  Six categories of operators ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In Java, there are six categories of operators.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;OL&amp;gt;&amp;lt;LI&amp;gt;Unary operators&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;Arithmetic operators&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;Relational and conditional operators&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;Shift and logical operators&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;Assignment operators&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;Other operators&amp;lt;/LI&amp;gt;&amp;lt;/OL&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
Precedence     Operator     Description                          Association&lt;br /&gt;
1              ++,--        Postincrement, Postdecrement         R -&amp;gt; L&lt;br /&gt;
2              ++,--        Preincrement, Predecrement           R -&amp;gt; L&lt;br /&gt;
               +,-          Unary plus, unary minus              R -&amp;gt; L&lt;br /&gt;
               ~            Bitwise compliment                   R -&amp;gt; L&lt;br /&gt;
               !            Boolean NOT                          R -&amp;gt; L&lt;br /&gt;
3              new          Create object                        R -&amp;gt; L&lt;br /&gt;
               (type)       Type cast                            R -&amp;gt; L&lt;br /&gt;
4              *,/,%        Multiplication, division, remainder  L -&amp;gt; R&lt;br /&gt;
5              +,-          Addition, subtraction                L -&amp;gt; R&lt;br /&gt;
               +            String concatenation                 L -&amp;gt; R&lt;br /&gt;
6              &amp;lt;&amp;lt;, &amp;gt;&amp;gt;, &amp;gt;&amp;gt;&amp;gt;  Left shift, right shift, unsigned right shift     L -&amp;gt; R&lt;br /&gt;
7              &amp;lt;, &amp;lt;=, &amp;gt;, &amp;gt;=                                      L -&amp;gt; R&lt;br /&gt;
               instanceof   Type comparison                      L -&amp;gt; R&lt;br /&gt;
8              ==, !=       Value equality and inequality        L -&amp;gt; R&lt;br /&gt;
               ==, !=       Reference equality and inequality    L -&amp;gt; R&lt;br /&gt;
9              &amp;amp;            Boolean AND                          L -&amp;gt; R&lt;br /&gt;
               &amp;amp;            Bitwise AND                          L -&amp;gt; R&lt;br /&gt;
10             ^            Boolean XOR                          L -&amp;gt; R&lt;br /&gt;
               ^            Bitwise XOR                          L -&amp;gt; R&lt;br /&gt;
11             |            Boolean OR                           L -&amp;gt; R&lt;br /&gt;
               |            Bitwise OR                           L -&amp;gt; R&lt;br /&gt;
12             &amp;amp;&amp;amp;           Conditional AND                      L -&amp;gt; R&lt;br /&gt;
13             ||           Conditional OR                       L -&amp;gt; R&lt;br /&gt;
14             ?:           Conditional Ternary Operator         L -&amp;gt; R&lt;br /&gt;
15             =,+=,-=,     Assignment Operators                 R -&amp;gt; L&lt;br /&gt;
               *=,/ =,%=,&lt;br /&gt;
               &amp;amp;=,^=, |=, &lt;br /&gt;
               &amp;lt;&amp;lt;=, &amp;gt;&amp;gt; =, &lt;br /&gt;
               &amp;gt;&amp;gt;&amp;gt;=&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  Tests all the operators on all the primitive data types to show which ones are accepted by the Java compiler ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public class MainClass {&lt;br /&gt;
   public static void main(String[] a){&lt;br /&gt;
      boolTest(true, false);&lt;br /&gt;
      charTest(&amp;quot;x&amp;quot;, &amp;quot;y&amp;quot;);&lt;br /&gt;
      byteTest((byte)0, (byte)1);&lt;br /&gt;
      shortTest((short)0, (short)1);&lt;br /&gt;
      intTest(1, 2);&lt;br /&gt;
      longTest(11L, 22L);&lt;br /&gt;
      floatTest(1.1F, 2.2F);&lt;br /&gt;
      doubleTest(1.1, 2.2);&lt;br /&gt;
   }&lt;br /&gt;
  // To accept the results of a boolean test:&lt;br /&gt;
  static void f(boolean b) {&lt;br /&gt;
     System.out.println(&amp;quot;f:&amp;quot;+b);  &lt;br /&gt;
  }&lt;br /&gt;
  static void boolTest(boolean x, boolean y) {&lt;br /&gt;
    // Arithmetic operators:&lt;br /&gt;
    //! x = x * y;&lt;br /&gt;
    //! x = x / y;&lt;br /&gt;
    //! x = x % y;&lt;br /&gt;
    //! x = x + y;&lt;br /&gt;
    //! x = x - y;&lt;br /&gt;
    //! x++;&lt;br /&gt;
    //! x--;&lt;br /&gt;
    //! x = +y;&lt;br /&gt;
    //! x = -y;&lt;br /&gt;
    // Relational and logical:&lt;br /&gt;
    //! f(x &amp;gt; y);&lt;br /&gt;
    //! f(x &amp;gt;= y);&lt;br /&gt;
    //! f(x &amp;lt; y);&lt;br /&gt;
    //! f(x &amp;lt;= y);&lt;br /&gt;
    f(x == y);&lt;br /&gt;
    f(x != y);&lt;br /&gt;
    f(!y);&lt;br /&gt;
    x = x &amp;amp;&amp;amp; y;&lt;br /&gt;
    x = x || y;&lt;br /&gt;
    // Bitwise operators:&lt;br /&gt;
    //! x = ~y;&lt;br /&gt;
    x = x &amp;amp; y;&lt;br /&gt;
    x = x | y;&lt;br /&gt;
    x = x ^ y;&lt;br /&gt;
    //! x = x &amp;lt;&amp;lt; 1;&lt;br /&gt;
    //! x = x &amp;gt;&amp;gt; 1;&lt;br /&gt;
    //! x = x &amp;gt;&amp;gt;&amp;gt; 1;&lt;br /&gt;
    // Compound assignment:&lt;br /&gt;
    //! x += y;&lt;br /&gt;
    //! x -= y;&lt;br /&gt;
    //! x *= y;&lt;br /&gt;
    //! x /= y;&lt;br /&gt;
    //! x %= y;&lt;br /&gt;
    //! x &amp;lt;&amp;lt;= 1;&lt;br /&gt;
    //! x &amp;gt;&amp;gt;= 1;&lt;br /&gt;
    //! x &amp;gt;&amp;gt;&amp;gt;= 1;&lt;br /&gt;
    x &amp;amp;= y;&lt;br /&gt;
    x ^= y;&lt;br /&gt;
    x |= y;&lt;br /&gt;
    // Casting:&lt;br /&gt;
    //! char c = (char)x;&lt;br /&gt;
    //! byte B = (byte)x;&lt;br /&gt;
    //! short s = (short)x;&lt;br /&gt;
    //! int i = (int)x;&lt;br /&gt;
    //! long l = (long)x;&lt;br /&gt;
    //! float f = (float)x;&lt;br /&gt;
    //! double d = (double)x;&lt;br /&gt;
  }&lt;br /&gt;
  static void charTest(char x, char y) {&lt;br /&gt;
    // Arithmetic operators:&lt;br /&gt;
    x = (char)(x * y);&lt;br /&gt;
    x = (char)(x / y);&lt;br /&gt;
    x = (char)(x % y);&lt;br /&gt;
    x = (char)(x + y);&lt;br /&gt;
    x = (char)(x - y);&lt;br /&gt;
    x++;&lt;br /&gt;
    x--;&lt;br /&gt;
    x = (char)+y;&lt;br /&gt;
    x = (char)-y;&lt;br /&gt;
    // Relational and logical:&lt;br /&gt;
    f(x &amp;gt; y);&lt;br /&gt;
    f(x &amp;gt;= y);&lt;br /&gt;
    f(x &amp;lt; y);&lt;br /&gt;
    f(x &amp;lt;= y);&lt;br /&gt;
    f(x == y);&lt;br /&gt;
    f(x != y);&lt;br /&gt;
    //! f(!x);&lt;br /&gt;
    //! f(x &amp;amp;&amp;amp; y);&lt;br /&gt;
    //! f(x || y);&lt;br /&gt;
    // Bitwise operators:&lt;br /&gt;
    x= (char)~y;&lt;br /&gt;
    x = (char)(x &amp;amp; y);&lt;br /&gt;
    x  = (char)(x | y);&lt;br /&gt;
    x = (char)(x ^ y);&lt;br /&gt;
    x = (char)(x &amp;lt;&amp;lt; 1);&lt;br /&gt;
    x = (char)(x &amp;gt;&amp;gt; 1);&lt;br /&gt;
    x = (char)(x &amp;gt;&amp;gt;&amp;gt; 1);&lt;br /&gt;
    // Compound assignment:&lt;br /&gt;
    x += y;&lt;br /&gt;
    x -= y;&lt;br /&gt;
    x *= y;&lt;br /&gt;
    x /= y;&lt;br /&gt;
    x %= y;&lt;br /&gt;
    x &amp;lt;&amp;lt;= 1;&lt;br /&gt;
    x &amp;gt;&amp;gt;= 1;&lt;br /&gt;
    x &amp;gt;&amp;gt;&amp;gt;= 1;&lt;br /&gt;
    x &amp;amp;= y;&lt;br /&gt;
    x ^= y;&lt;br /&gt;
    x |= y;&lt;br /&gt;
    // Casting:&lt;br /&gt;
    //! boolean b = (boolean)x;&lt;br /&gt;
    byte B = (byte)x;&lt;br /&gt;
    short s = (short)x;&lt;br /&gt;
    int i = (int)x;&lt;br /&gt;
    long l = (long)x;&lt;br /&gt;
    float f = (float)x;&lt;br /&gt;
    double d = (double)x;&lt;br /&gt;
  }&lt;br /&gt;
  static void byteTest(byte x, byte y) {&lt;br /&gt;
    // Arithmetic operators:&lt;br /&gt;
    x = (byte)(x* y);&lt;br /&gt;
    x = (byte)(x / y);&lt;br /&gt;
    x = (byte)(x % y);&lt;br /&gt;
    x = (byte)(x + y);&lt;br /&gt;
    x = (byte)(x - y);&lt;br /&gt;
    x++;&lt;br /&gt;
    x--;&lt;br /&gt;
    x = (byte)+ y;&lt;br /&gt;
    x = (byte)- y;&lt;br /&gt;
    // Relational and logical:&lt;br /&gt;
    f(x &amp;gt; y);&lt;br /&gt;
    f(x &amp;gt;= y);&lt;br /&gt;
    f(x &amp;lt; y);&lt;br /&gt;
    f(x &amp;lt;= y);&lt;br /&gt;
    f(x == y);&lt;br /&gt;
    f(x != y);&lt;br /&gt;
    //! f(!x);&lt;br /&gt;
    //! f(x &amp;amp;&amp;amp; y);&lt;br /&gt;
    //! f(x || y);&lt;br /&gt;
    // Bitwise operators:&lt;br /&gt;
    x = (byte)~y;&lt;br /&gt;
    x = (byte)(x &amp;amp; y);&lt;br /&gt;
    x = (byte)(x | y);&lt;br /&gt;
    x = (byte)(x ^ y);&lt;br /&gt;
    x = (byte)(x &amp;lt;&amp;lt; 1);&lt;br /&gt;
    x = (byte)(x &amp;gt;&amp;gt; 1);&lt;br /&gt;
    x = (byte)(x &amp;gt;&amp;gt;&amp;gt; 1);&lt;br /&gt;
    // Compound assignment:&lt;br /&gt;
    x += y;&lt;br /&gt;
    x -= y;&lt;br /&gt;
    x *= y;&lt;br /&gt;
    x /= y;&lt;br /&gt;
    x %= y;&lt;br /&gt;
    x &amp;lt;&amp;lt;= 1;&lt;br /&gt;
    x &amp;gt;&amp;gt;= 1;&lt;br /&gt;
    x &amp;gt;&amp;gt;&amp;gt;= 1;&lt;br /&gt;
    x &amp;amp;= y;&lt;br /&gt;
    x ^= y;&lt;br /&gt;
    x |= y;&lt;br /&gt;
    // Casting:&lt;br /&gt;
    //! boolean b = (boolean)x;&lt;br /&gt;
    char c = (char)x;&lt;br /&gt;
    short s = (short)x;&lt;br /&gt;
    int i = (int)x;&lt;br /&gt;
    long l = (long)x;&lt;br /&gt;
    float f = (float)x;&lt;br /&gt;
    double d = (double)x;&lt;br /&gt;
  }&lt;br /&gt;
  static void shortTest(short x, short y) {&lt;br /&gt;
    // Arithmetic operators:&lt;br /&gt;
    x = (short)(x * y);&lt;br /&gt;
    x = (short)(x / y);&lt;br /&gt;
    x = (short)(x % y);&lt;br /&gt;
    x = (short)(x + y);&lt;br /&gt;
    x = (short)(x - y);&lt;br /&gt;
    x++;&lt;br /&gt;
    x--;&lt;br /&gt;
    x = (short)+y;&lt;br /&gt;
    x = (short)-y;&lt;br /&gt;
    // Relational and logical:&lt;br /&gt;
    f(x &amp;gt; y);&lt;br /&gt;
    f(x &amp;gt;= y);&lt;br /&gt;
    f(x &amp;lt; y);&lt;br /&gt;
    f(x &amp;lt;= y);&lt;br /&gt;
    f(x == y);&lt;br /&gt;
    f(x != y);&lt;br /&gt;
    //! f(!x);&lt;br /&gt;
    //! f(x &amp;amp;&amp;amp; y);&lt;br /&gt;
    //! f(x || y);&lt;br /&gt;
    // Bitwise operators:&lt;br /&gt;
    x = (short)~y;&lt;br /&gt;
    x = (short)(x &amp;amp; y);&lt;br /&gt;
    x = (short)(x | y);&lt;br /&gt;
    x = (short)(x ^ y);&lt;br /&gt;
    x = (short)(x &amp;lt;&amp;lt; 1);&lt;br /&gt;
    x = (short)(x &amp;gt;&amp;gt; 1);&lt;br /&gt;
    x = (short)(x &amp;gt;&amp;gt;&amp;gt; 1);&lt;br /&gt;
    // Compound assignment:&lt;br /&gt;
    x += y;&lt;br /&gt;
    x -= y;&lt;br /&gt;
    x *= y;&lt;br /&gt;
    x /= y;&lt;br /&gt;
    x %= y;&lt;br /&gt;
    x &amp;lt;&amp;lt;= 1;&lt;br /&gt;
    x &amp;gt;&amp;gt;= 1;&lt;br /&gt;
    x &amp;gt;&amp;gt;&amp;gt;= 1;&lt;br /&gt;
    x &amp;amp;= y;&lt;br /&gt;
    x ^= y;&lt;br /&gt;
    x |= y;&lt;br /&gt;
    // Casting:&lt;br /&gt;
    //! boolean b = (boolean)x;&lt;br /&gt;
    char c = (char)x;&lt;br /&gt;
    byte B = (byte)x;&lt;br /&gt;
    int i = (int)x;&lt;br /&gt;
    long l = (long)x;&lt;br /&gt;
    float f = (float)x;&lt;br /&gt;
    double d = (double)x;&lt;br /&gt;
  }&lt;br /&gt;
  static void intTest(int x, int y) {&lt;br /&gt;
    // Arithmetic operators:&lt;br /&gt;
    x = x * y;&lt;br /&gt;
    x = x / y;&lt;br /&gt;
    x = x % y;&lt;br /&gt;
    x = x + y;&lt;br /&gt;
    x = x - y;&lt;br /&gt;
    x++;&lt;br /&gt;
    x--;&lt;br /&gt;
    x = +y;&lt;br /&gt;
    x = -y;&lt;br /&gt;
    // Relational and logical:&lt;br /&gt;
    f(x &amp;gt; y);&lt;br /&gt;
    f(x &amp;gt;= y);&lt;br /&gt;
    f(x &amp;lt; y);&lt;br /&gt;
    f(x &amp;lt;= y);&lt;br /&gt;
    f(x == y);&lt;br /&gt;
    f(x != y);&lt;br /&gt;
    //! f(!x);&lt;br /&gt;
    //! f(x &amp;amp;&amp;amp; y);&lt;br /&gt;
    //! f(x || y);&lt;br /&gt;
    // Bitwise operators:&lt;br /&gt;
    x = ~y;&lt;br /&gt;
    x = x &amp;amp; y;&lt;br /&gt;
    x = x | y;&lt;br /&gt;
    x = x ^ y;&lt;br /&gt;
    x = x &amp;lt;&amp;lt; 1;&lt;br /&gt;
    x = x &amp;gt;&amp;gt; 1;&lt;br /&gt;
    x = x &amp;gt;&amp;gt;&amp;gt; 1;&lt;br /&gt;
    // Compound assignment:&lt;br /&gt;
    x += y;&lt;br /&gt;
    x -= y;&lt;br /&gt;
    x *= y;&lt;br /&gt;
    x /= y;&lt;br /&gt;
    x %= y;&lt;br /&gt;
    x &amp;lt;&amp;lt;= 1;&lt;br /&gt;
    x &amp;gt;&amp;gt;= 1;&lt;br /&gt;
    x &amp;gt;&amp;gt;&amp;gt;= 1;&lt;br /&gt;
    x &amp;amp;= y;&lt;br /&gt;
    x ^= y;&lt;br /&gt;
    x |= y;&lt;br /&gt;
    // Casting:&lt;br /&gt;
    //! boolean b = (boolean)x;&lt;br /&gt;
    char c = (char)x;&lt;br /&gt;
    byte B = (byte)x;&lt;br /&gt;
    short s = (short)x;&lt;br /&gt;
    long l = (long)x;&lt;br /&gt;
    float f = (float)x;&lt;br /&gt;
    double d = (double)x;&lt;br /&gt;
  }&lt;br /&gt;
  static void longTest(long x, long y) {&lt;br /&gt;
    // Arithmetic operators:&lt;br /&gt;
    x = x * y;&lt;br /&gt;
    x = x / y;&lt;br /&gt;
    x = x % y;&lt;br /&gt;
    x = x + y;&lt;br /&gt;
    x = x - y;&lt;br /&gt;
    x++;&lt;br /&gt;
    x--;&lt;br /&gt;
    x = +y;&lt;br /&gt;
    x = -y;&lt;br /&gt;
    // Relational and logical:&lt;br /&gt;
    f(x &amp;gt; y);&lt;br /&gt;
    f(x &amp;gt;= y);&lt;br /&gt;
    f(x &amp;lt; y);&lt;br /&gt;
    f(x &amp;lt;= y);&lt;br /&gt;
    f(x == y);&lt;br /&gt;
    f(x != y);&lt;br /&gt;
    //! f(!x);&lt;br /&gt;
    //! f(x &amp;amp;&amp;amp; y);&lt;br /&gt;
    //! f(x || y);&lt;br /&gt;
    // Bitwise operators:&lt;br /&gt;
    x = ~y;&lt;br /&gt;
    x = x &amp;amp; y;&lt;br /&gt;
    x = x | y;&lt;br /&gt;
    x = x ^ y;&lt;br /&gt;
    x = x &amp;lt;&amp;lt; 1;&lt;br /&gt;
    x = x &amp;gt;&amp;gt; 1;&lt;br /&gt;
    x = x &amp;gt;&amp;gt;&amp;gt; 1;&lt;br /&gt;
    // Compound assignment:&lt;br /&gt;
    x += y;&lt;br /&gt;
    x -= y;&lt;br /&gt;
    x *= y;&lt;br /&gt;
    x /= y;&lt;br /&gt;
    x %= y;&lt;br /&gt;
    x &amp;lt;&amp;lt;= 1;&lt;br /&gt;
    x &amp;gt;&amp;gt;= 1;&lt;br /&gt;
    x &amp;gt;&amp;gt;&amp;gt;= 1;&lt;br /&gt;
    x &amp;amp;= y;&lt;br /&gt;
    x ^= y;&lt;br /&gt;
    x |= y;&lt;br /&gt;
    // Casting:&lt;br /&gt;
    //! boolean b = (boolean)x;&lt;br /&gt;
    char c = (char)x;&lt;br /&gt;
    byte B = (byte)x;&lt;br /&gt;
    short s = (short)x;&lt;br /&gt;
    int i = (int)x;&lt;br /&gt;
    float f = (float)x;&lt;br /&gt;
    double d = (double)x;&lt;br /&gt;
  }&lt;br /&gt;
  static void floatTest(float x, float y) {&lt;br /&gt;
    // Arithmetic operators:&lt;br /&gt;
    x = x * y;&lt;br /&gt;
    x = x / y;&lt;br /&gt;
    x = x % y;&lt;br /&gt;
    x = x + y;&lt;br /&gt;
    x = x - y;&lt;br /&gt;
    x++;&lt;br /&gt;
    x--;&lt;br /&gt;
    x = +y;&lt;br /&gt;
    x = -y;&lt;br /&gt;
    // Relational and logical:&lt;br /&gt;
    f(x &amp;gt; y);&lt;br /&gt;
    f(x &amp;gt;= y);&lt;br /&gt;
    f(x &amp;lt; y);&lt;br /&gt;
    f(x &amp;lt;= y);&lt;br /&gt;
    f(x == y);&lt;br /&gt;
    f(x != y);&lt;br /&gt;
    //! f(!x);&lt;br /&gt;
    //! f(x &amp;amp;&amp;amp; y);&lt;br /&gt;
    //! f(x || y);&lt;br /&gt;
    // Bitwise operators:&lt;br /&gt;
    //! x = ~y;&lt;br /&gt;
    //! x = x &amp;amp; y;&lt;br /&gt;
    //! x = x | y;&lt;br /&gt;
    //! x = x ^ y;&lt;br /&gt;
    //! x = x &amp;lt;&amp;lt; 1;&lt;br /&gt;
    //! x = x &amp;gt;&amp;gt; 1;&lt;br /&gt;
    //! x = x &amp;gt;&amp;gt;&amp;gt; 1;&lt;br /&gt;
    // Compound assignment:&lt;br /&gt;
    x += y;&lt;br /&gt;
    x -= y;&lt;br /&gt;
    x *= y;&lt;br /&gt;
    x /= y;&lt;br /&gt;
    x %= y;&lt;br /&gt;
    //! x &amp;lt;&amp;lt;= 1;&lt;br /&gt;
    //! x &amp;gt;&amp;gt;= 1;&lt;br /&gt;
    //! x &amp;gt;&amp;gt;&amp;gt;= 1;&lt;br /&gt;
    //! x &amp;amp;= y;&lt;br /&gt;
    //! x ^= y;&lt;br /&gt;
    //! x |= y;&lt;br /&gt;
    // Casting:&lt;br /&gt;
    //! boolean b = (boolean)x;&lt;br /&gt;
    char c = (char)x;&lt;br /&gt;
    byte B = (byte)x;&lt;br /&gt;
    short s = (short)x;&lt;br /&gt;
    int i = (int)x;&lt;br /&gt;
    long l = (long)x;&lt;br /&gt;
    double d = (double)x;&lt;br /&gt;
  }&lt;br /&gt;
  static void doubleTest(double x, double y) {&lt;br /&gt;
    // Arithmetic operators:&lt;br /&gt;
    x = x * y;&lt;br /&gt;
    x = x / y;&lt;br /&gt;
    x = x % y;&lt;br /&gt;
    x = x + y;&lt;br /&gt;
    x = x - y;&lt;br /&gt;
    x++;&lt;br /&gt;
    x--;&lt;br /&gt;
    x = +y;&lt;br /&gt;
    x = -y;&lt;br /&gt;
    // Relational and logical:&lt;br /&gt;
    f(x &amp;gt; y);&lt;br /&gt;
    f(x &amp;gt;= y);&lt;br /&gt;
    f(x &amp;lt; y);&lt;br /&gt;
    f(x &amp;lt;= y);&lt;br /&gt;
    f(x == y);&lt;br /&gt;
    f(x != y);&lt;br /&gt;
    //! f(!x);&lt;br /&gt;
    //! f(x &amp;amp;&amp;amp; y);&lt;br /&gt;
    //! f(x || y);&lt;br /&gt;
    // Bitwise operators:&lt;br /&gt;
    //! x = ~y;&lt;br /&gt;
    //! x = x &amp;amp; y;&lt;br /&gt;
    //! x = x | y;&lt;br /&gt;
    //! x = x ^ y;&lt;br /&gt;
    //! x = x &amp;lt;&amp;lt; 1;&lt;br /&gt;
    //! x = x &amp;gt;&amp;gt; 1;&lt;br /&gt;
    //! x = x &amp;gt;&amp;gt;&amp;gt; 1;&lt;br /&gt;
    // Compound assignment:&lt;br /&gt;
    x += y;&lt;br /&gt;
    x -= y;&lt;br /&gt;
    x *= y;&lt;br /&gt;
    x /= y;&lt;br /&gt;
    x %= y;&lt;br /&gt;
    //! x &amp;lt;&amp;lt;= 1;&lt;br /&gt;
    //! x &amp;gt;&amp;gt;= 1;&lt;br /&gt;
    //! x &amp;gt;&amp;gt;&amp;gt;= 1;&lt;br /&gt;
    //! x &amp;amp;= y;&lt;br /&gt;
    //! x ^= y;&lt;br /&gt;
    //! x |= y;&lt;br /&gt;
    // Casting:&lt;br /&gt;
    //! boolean b = (boolean)x;&lt;br /&gt;
    char c = (char)x;&lt;br /&gt;
    byte B = (byte)x;&lt;br /&gt;
    short s = (short)x;&lt;br /&gt;
    int i = (int)x;&lt;br /&gt;
    long l = (long)x;&lt;br /&gt;
    float f = (float)x;&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  The op= Operators ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;count += 5  has the same effect as the statement: count = count + 5;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public class MainClass {&lt;br /&gt;
  public static void main(String[] arg) {&lt;br /&gt;
    int count = 1;&lt;br /&gt;
    count += 5;&lt;br /&gt;
    System.out.println(count);&lt;br /&gt;
    count = count + 5;&lt;br /&gt;
    System.out.println(count);&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;6&lt;br /&gt;
11&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The complete set of op= operators:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;OL&amp;gt;&amp;lt;LI&amp;gt;+=&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;-=&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;*=&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;/=&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;%=&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;&amp;lt;&amp;lt;=&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;&amp;gt;&amp;gt;=&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;&amp;gt;&amp;gt;&amp;gt;=&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;&amp;amp;=&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;|=&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;^=&amp;lt;/LI&amp;gt;&amp;lt;/OL&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  The ternary operator (The Conditional Operator): result = value&amp;gt;conditionValue ? result1 : result2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
if(value &amp;gt; conditionValue){&lt;br /&gt;
  result = result1;&lt;br /&gt;
}else{&lt;br /&gt;
  result = result2;&lt;br /&gt;
}&lt;br /&gt;
 logical_expression ? expression1 : expression2&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;A&lt;br /&gt;
B&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
			</entry>

	</feed>