// for loop and while loop
public class ForWhile {
public static void main(String[] args) {
for (int i = 1; i <= 5; i++) {
int j = i;while (j <= 5) {
System.out.print(j);
j++;
}System.out.println(" ");
}
}
}
Output:* * * * *
* * * *
* * *
* *
*
// for loop and while loop
public class ForWhile {
public static void main(String[] args) {
for (int i = 1; i <= 5; i++) {
int j = i;while (j <= 5) {
System.out.print(j);
j++;
}System.out.println(" ");
}
}
}
Output:* * * * *
* * * *
* * *
* *
*
Program to use Bitwise Short-hand assignment operator in Java
stringBuffer deleteCharAt() method in Java
Swapping of Variables without using Third Variable in Java
Java Program to use values() and valueOf() methods of Enum
How to create Local Constant in Java
capacity() method example in Java
Increment Operator Example in Java
Program to explain Importing Package in Java
Program to explain Polymorphism with abstract class in Java
Program to use Applet with Button and it's event in Java
Program to Print Lucas series in Java
toLowerCase() method example in Java
Array of String Example in Java
Logical Bitwise Operators Examples in Java
Program to explain Importing Package example in Java