VARIABLE, DATA TYPE AND OPERATORS
Variables play an important role in computer programming because they enable programmers to write flexible programs. Rather than entering data directly into a program, a programmer can use variables to represent the data. Then, when the program is executed, the variables are replaced with real data. This makes it possible for the same program to process different sets of data.
Every variable has a name, called the variable name, and a data type.
Type of Variable:
Local variable: Declared inside the Method.
Instance variable: Declared inside the class but out side the Method. It is not declared as Static. Static variable: Declared as static it can not be local.
Example:
Data Type: Java support Primitive Data Type and Non-Primitive Data Type.
Operator Precedence:
Type of Variable:
Local variable: Declared inside the Method.
Instance variable: Declared inside the class but out side the Method. It is not declared as Static. Static variable: Declared as static it can not be local.
Example:
Data Type: Java support Primitive Data Type and Non-Primitive Data Type.
DATA TYPE
|
DEFAULT VALUE
|
DEFAULT SIZE
|
Boolean
|
false
|
1 bit
|
byte
|
0
|
1 byte
|
char
|
'\u0000'
|
2 byte
|
short
|
0
|
2 byte
|
int
|
0
|
4 byte
|
float
|
0.0f
|
4 byte
|
long
|
0L
|
8 byte
|
double
|
0.0d
|
8 byte
|
object
|
null
|
-
|
Operator Precedence:
Operators | Precedence |
Postfix | expr++, expr-- |
Unary | ++expr, --expr, +expr, -expr |
Multiplicative | *, /, % |
Additive | +, - |
Shift | <<, >>, >>> |
Relational | <<, <=, >=, instanceof |
Equality | ==, != |
Bitwise AND | & |
Bitwise Exclusive OR | ^ |
Bitwise Inclusive OR | | |
Logic AND | && |
Logic OR | || |
Ternary | ?: |
Assignment | =, +=, -+, *=, /=, %=, &=, ^=, <=, >>=, >>>= |
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment
Please Write a Message for Programming or something Related issues.