Revision-2
Variables are like containers that hold data within our programs.
int
double
boolean
char
Arithmetic operators
Assignment operators
Comparison operators
Logical operators
Bitwise operators
If-Else Statements
Loops
While Loop
Do-While Loop
For Loop
Switch Statements
Java Methods is a block of code that performs a specific task and can be called from other parts of our program. It helps avoid code duplication and promotes modular programming.
Java Functions Functions in Java are similar to methods but are typically associated with functional programming paradigms. They are self-contained and can return a value.
Java Libraries are pre-written code modules that provide a wide range of functionality to developers. They offer ready-to-use methods, classes, and utilities that simplify complex tasks. To use a Java library, we need to import it into our code using the import statement.
Importing the Scanner Class
Creating an Instance of Scanner
Reading Different Data Types
Reading an integer
Reading a floating-point number
Reading a string
Handling User Input