2. Operators
• An operator is a symbol that performs mathematical or logical operations.
• Java supports several types of operators such as Arithmetic, Assignment,
Relational, Logical, Bitwise, etc.
• Operators work on variables and values to produce a result.
4. Tokens in Java
• Tokens are the smallest individual units in a Java program.
• They include keywords, identifiers, literals, operators, and separators.
• Java uses tokens to build expressions and statements.
5. Separators in Java
• Separators help separate different tokens.
• They include symbols like (), {}, [], ;, and ,.
• They are also known as punctuators.
6. Constants, Variables, Data Types
• Constants: Fixed values that do not change during execution. Declared using the
'final' keyword.
• Variables: Named storage locations for data. Their values can change during
program execution.
• Data Types: Define the type of data a variable can hold, e.g., int, float, char,
boolean.
7. Operators and Expressions
• Operators: Symbols that perform operations on variables and values.
• Expressions: Combinations of variables, constants, and operators that yield a
result.
8. Decision Making and Branching
• if: Executes a block if the condition is true.
• if...else: Executes one block if true, another if false.
• nested if: if statements inside another if.
• switch: Selects among multiple blocks based on a variable value.
• ?: (Ternary Operator): Shorthand for if...else.
9. Decision Making and Looping
• while: Repeats a block while a condition is true.
• do...while: Executes at least once, then checks condition.
• for: Repeats a block a specific number of times.
10. Jumps in Loops - Labeled Loops
• break: Exits the loop immediately.
• continue: Skips the rest of the current iteration.
• Labeled Loops: Used with break/continue to specify the loop to affect.
11. Classes, Objects and Methods
• Class: Blueprint for creating objects. Defines fields and methods.
• Object: Instance of a class with its own values.
• Method: Block of code performing a task, can be called on objects.