Java Notes
Java Notes
English code -> java compiler -> byte code -> java virtual machine -> machine
readable code -> output execute.
2.Data 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
5.Logical operators
1.&&(AND)
2.||(OR)
3.dividing(module %(num%2 == 0))
6.else 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.
7.Nested if :
In (nested if) condition inside a (if statement)we can add another (if
statement).
8.Ternary operator:
Syntax:
variable = (condition)?"value if true" : "value if false"