Java Reference
In-Depth Information
In the examples so far, you have used the C++ style comments, since they are
line oriented, like COBOL comments:
// This member is available to any class.
public String msgText;
The C style comments are also sometimes used, especially for multiline com-
ments, but here is a word of caution: This style can cause code to be inadvertently
commented out.
/* This member is available to any class.
Its access modifier is public */
public String msgText;
/* All these lines are comment lines.
public String msgText;
Let's hope your editing environment will make this obvious */
I will discuss Javadoc comments in Chapter 12.
Examples in this topic generally use the two forward slashes (//) style of com-
ments declaration.
J AVA O PERATORS
Java provides for the usual arithmetic assignment operators. Most of these are sim-
ilar to the operators available in COBOL's COMPUTE statement.
*
Multiplication
/
Division
%
Modulo
+
Addition
-
Subtraction
=
Assignment
As you would expect, there are precedence standards, and parentheses can be
used to override or clarify any precedence conventions.
x = 2 + 7 * 3; // x = 23
x = (2 + 7) * 3; // x = 27
Search WWH ::




Custom Search