1.
Control Statements in Java
Control statements control the flow of execution in a Java program. They include selection
statements (if, switch), iteration statements (for, while, do-while), and jump statements (break,
continue).
2. Operators in Java
Operators are special symbols used to perform operations on operands. Java supports arithmetic,
relational, logical, assignment, and other operators.
3. Java Program Structure
A Java program consists of package statement, import statement, class definition, main method,
variables, statements, and comments.
4. Java Statements
Java statements are instructions that perform actions such as declaration, decision making,
looping, and branching.
5. Primitive and Non-Primitive Data Types
Primitive data types store simple values, while non-primitive data types store references to objects
like arrays, strings, and classes.
6. Difference Between while, do-while, and for Loop
while checks condition before execution, do-while executes at least once, and for loop is used when
number of iterations is known.
7. Variable Scope in Java
Variable scope defines the accessibility and lifetime of variables. Java supports local, instance, and
static variables.
8. Prime Number Program using while Loop
A prime number has only two factors: 1 and itself. A while loop checks divisibility to determine
primality.