Java Jeevan
Java Jeevan
Simple
Architecture-neutral
Object-Oriented
Portable
Distributed
Interpreted
Multithreaded
Robust
Secure
Characteristics
The Java Platform
class body
}
Comments
The ASCII character set is older and smaller than Unicode, but is still
quite popular
The ASCII characters are a subset of the Unicode character set,
including:
uppercase letters A, B, C, …
lowercase letters a, b, c, …
punctuation period, semi-colon, …
digits 0, 1, 2, …
special symbols &, |, \, …
Boolean
int sum = 0;
int base = 32, max = 149;
total = 55;
The expression on the right is evaluated and the result is stored in the variable on the left
The value that was in total is overwritten
You can only assign a value to a variable that is consistent with the variable's declared
type
Constants
Addition +
Subtraction -
Multiplication *
Division /
Remainder %
If either or both operands to an arithmetic operator are floating point,
the result is a floating point
Bitwise Operators
~ Unary Not ~a
| Or a|b
^ Xor a^b
< a<b
> a>b
<= a<=b
>= >=b
<<
Logical Operators
| Logical or a|b
! Unary not !a
8 / 12 equals? 0
The remainder operator (%) returns the remainder after dividing the second
operand into the first
14 % 3 equals? 2
8 % 12 equals? 8
Operator Precedence
coding standards:
Variable and method names (also add prefixes discussed
earlier)
Class names
Constant names
Braces
Comments
Source File organization
Life Cycle of Java Code
Editor
Programmer