Data classes, and operators

Escape character \ t \ n
constant - amount does not change
the value ----
string constant "HelloWorld" "10"
integer constant 10 11
9.8
the amount of energy change of variables

true
false

Naming variables: See name known meaning
clear and concise English words to represent your variable names.
If your word is a word lowercase directly on the line
if it is two words ---- hump


int a = 10;
int b = 20;
int c = 30;

int [] scores = new int[30];

String name = "许坤";

String [] names = new String[30];

 


double [] d=new double[30];


Operator
1: Arithmetic Operators
+ plus
- minus
* Multiplication
/ Division
% I = 17 5% 2% 2 = 1
+ 1 is added to itself -
Counter ----
- Save 1
9876;
taken ten- hundreds digit
%
9876% 10 =
2: assignment operator
= to assign values equal (assignment symbol) right to left
int a = 10;
the 10 assigned to this value of a variable of type int

+ = plus the left and right, etc. adding left to give.
A 10 = int;
int = 20 is B;

A = B +;
Print (A)
used for the accumulated sum
- =
* =
/ =
% =
Exercises: / *
* Zhang's Score 98;
* Xu Kun Zhang's achievements and as high performance.
Xu Kun * seeking results:
* /

Exercise 2:
Known = 10 A;
B = 20 is;
Print (A) = 10;
Print (B) = 20 is;

Swap the values of a and b;

Print (a) = 20 is
Print (b) = 10;


a = 10

b=20

a,b = b,a

print(a)
print(b)

20
10

The In [22 is]:
+ connector;
3: Relational operators:
== equal constant mean.
>
<
> = Greater than or equal to
<=
= is not equal to!
1 == 1

the result is the boolean to false to true
4: the expression:

1 + 1
1 + 2 * 3--5 * 4 + 2 - 2
1 2 * 3 +
1 * 2 + 3
left
int a = 10
. 1. 1 = a + 2 + + +. 1. 4. 5 *
when confronted of assignments; it becomes right;


expression (expression) is operator (operator) and the operand (the operand)
>>> # constituted sequence.


Methods: The complete block of code specific function.

Guess you like

Origin www.cnblogs.com/fxlcd/p/11370417.html