1/23
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Java input
It means receiving data from an external source, like the keyboard or a file.
Java output
It prints text or values to the console.
print()
This method prints the given text or value without moving to a new line
println()
It prints the text or value and then moves to the next line.
Sequential Structure
The program executes statements one after another in the exact order
Conditional Statements
These are instructions that help your program make decisions
If statement
It allows you to run a block of code only if a specifies condition is true
If Else statement
It lets you choose between two blocks of code; one runs if true, the other if false.
if-Else-if statement
Allows you to check multiple conditions sequentially. The first true condition’s block runs, and the rest are skipped.
Switch Statement
It lets you select one block of code to execute based on the value of a single variable
Java Loops
are used to repeat a block of code multiple times until a specific condition is met.
for loop
It is a control statement that lets you repeat a block of code a specific number of time.
While loop
it allows you to run a block of code only if a specified condition is true
do-while loop
It is a type of loop that executes the block first, and then checks the condition
Break Statement
Used to immediately exit a loop or switch case, regardless of the remaining iterations or cases.
Break in for loop
It is used when you want to stop looping once a condition is false
Break in while loop
This helps exit early based on a condition that occurs during runtime
Break in do-while loop
It immediately exits the loop when encountered
Break in switch case
It is used to terminate a case block, preventing the execution from falling through
Continue statement
It is used inside loops to skip the rest of the current iteration and jump to the next one
Continue in for loop
It skips the current iteration and moves directly to the update statement
Continue in while loop
It skips the remaining code and jumps to condition check
Continue in do-while loop
It skips at the end of the loop after executing the code
Return statement
It is used inside a method to send a value back to the code that called the method