Java Notes
Java Notes
Type Casting: Type casting is when you assign a value of one primitive data type to another
type
Reverse Number:
while (num > 0) {
}
System.out.println(ans);
Squarem Pattern:
for (int i = 1; i <= 5; i++) {
if (i == 1 || j == 1 || i == 5 || j == 5) {
System.out.print("*");
} else {
System.out.print(" ");
}
}
System.out.println();
static keyword : The static keyword in Java is used for memory management mainly
We can apply static keyword with variables, methods, blocks and nested classes.
The static keyword belongs to the class than an instance of the class.