For Loop:
The for loop is used when the number of iterations is known beforehand.
It has three parts: initializing the counter, a condition for continuation, and
increment or decrement of the counter.
While Loop:
The while loop is used when the number of iterations is not known beforehand.
It has a condition for continuation that is checked before each iteration.
Do-While Loop:
The do-while loop is similar to the while loop, but it checks the condition after
each iteration.
This means that the loop will always execute at least once.
Java Fundamentals and Output:
Variables and Data Types:
Variables: A container to store data which can be of different types.
Data Types: The type of data that a variable can hold, such as int, char, double,
etc.
Primitive: Basic data types in Java, such as int, char, boolean, etc.
Non-primitive: Complex data types, such as arrays, strings, and user-defined types.
User Input and Scanner Class:
Scanner Class:
A pre-defined class used for taking input from the user.
It can take input in various formats, such as int, char, double, etc.
Functions and Methods:
Functions:
A block of code that performs a specific task.
Can be defined by the user or predefined by the programming language.
Methods:
Functions associated with a particular class or object in Java.
Can be used to manipulate the state of the class or object.
Conditional Statements:
If-Else:
Allows for decision making based on a certain condition.
Consists of an 'if' statement followed by 'else if' and/or 'else' statements.
Arrays and Multidimensional Arrays:
Arrays:
A collection of elements of the same data type.
Accessed by their index.
Multidimensional Arrays:
A collection of arrays.
Can be accessed by multiple indices.
This is not an exhaustive explanation of the mentioned topics, but rather a brief
overview. For more in-depth knowledge, refer to the relevant resources or consult a
Java textbook.