Home > Articles > Programming > Java

  • Print
  • + Share This
This chapter is from the book

Summary

Anyone who pops open a set of matryoska dolls has to be a bit disappointed to reach the smallest doll in the group. Ideally, advances in microengineering should enable Russian artisans to create ever-smaller and smaller dolls, until someone reaches the subatomic threshold and is declared the winner.

You have reached Java's smallest nesting doll today, but it shouldn't be a letdown. Using statements and expressions enables you to begin building effective methods, which make effective objects and classes possible.

Today you learned about creating variables and assigning values to them; using literals to represent numeric, character, and string values; and working with operators. Tomorrow you put these skills to use as you develop objects for Java programs.

To summarize today's material, Table 3.7 lists the operators you learned about. Be a doll and look them over carefully.

Table 3.7 Operator Summary

Operator

Meaning

+

Addition

-

Subtraction

*

Multiplication

/

Division

%

Modulus

<

Less than

>

Greater than

<=

Less than or equal to

>=

Greater than or equal to

==

Equal

!=

Not equal

&&

Logical AND

||

Logical OR

!

Logical NOT

&

AND

|

OR

^

XOR

=

Assignment

++

Increment

--

Decrement

+=

Add and assign

-=

Subtract and assign

*=

Multiply and assign

/=

Divide and assign

%=

Modulus and assign


  • + Share This
  • 🔖 Save To Your Account