A variable is a name of the memory location. It is used to store data. Its value can be changed, and it can be reused many times.
Rules:
A variable can have alphabets, digits, and underscore.
A variable name can start with the alphabet, and underscore only. It can't start with a digit.
No whitespace is allowed within the variable name.
A variable name must not be any reserved word or keyword. e.g: int, float, etc.
Types:
Local variable
Instance variable
Static variable
Data Types:
A Data type specifies the type of data that a variable can store.
Types:
Primitive:
Data Types
Size
boolean
1 bit
char
2 byte
byte
1 byte
short
2 byte
int
4 byte
long
8 byte
float
4 byte
double
8 byte
Non Primitive:
Sting
Array,etc
Operators:
An Operator is simply a symbol that is used to perform operations.
Types:
Arithmetic Operators
Relational Operators
Shift Operators
Logical Operators
Bitwise Operators
Ternary or Conditional Operators
Assignment Operator
Unary Operator
Control Statements:
A Control Statement is used to check the conditon.
Types:
If statement
If-else statement
If else-if ladder
Nested If
Looping Statements:
The Looping can be defined as repeating the same process multiple times until a specific condition satisfies. There are four types of loops used in the JAVA language.
Types:
For loop
For-Each loop
While loop
Do-While loop
Nested loop
Array:
An Array is defined as the collection of similar type of data items stored at contiguous memory locations. Arrays are the derived data type in C programming language which can store the primitive type of data such as int, char, double, float, etc. It also has the capability to store the collection of derived data types, such as pointers, structure, etc. The array is the simplest data structure where each data element can be randomly accessed by using its index number.