How java works:
English code -> java compiler -> byte code -> java virtual machine -> machine
readable code -> output execute.
Variables and Data Types:
[Link] = stores datas
Example:
A = 10
//here A is a variable
[Link] Types:
(1) Byte data type.
(2) Boolean data type.
(3) Int data type.
(4) Short data type.
(5) Char data type.
(6) Double data type.
(7) Float data type.
(8) Long data type.
Example:
int A = 10
//here int is a data type
[Link] memory works
memory city = stack + heap
| / \
int a=10 object string pool
|
name ="john"
[Link] two strings
syntax:
a1 = abc;
a2 = xyz;
if([Link](a2));
[Link] operators
1.&&(AND)
2.||(OR)
[Link](module %(num%2 == 0))
[Link] if :
In normal (if else) condition the if condition is false it will automatically
print the else condition,
but in (else if) condition if the (if statement) is false it will check the (else
if) statement it wiil
not directly print the else statement and once the statement becomes true the
program will be stopped.
[Link] if :
In (nested if) condition inside a (if statement)we can add another (if
statement).
[Link] operator:
Syntax:
variable = (condition)?"value if true" : "value if false"