// For loop pattern
public class NestedFor {
public static void main(String[] args) {
for (int i = 0; i < 5; i++) {
for (int j = 0; j <= i; j++) {
System.out.print("* ");
}
System.out.println();
}
}
}
Output:*
* *
* * *
* * * *
* * * * *
// For loop pattern
public class NestedFor {
public static void main(String[] args) {
for (int i = 0; i < 5; i++) {
for (int j = 0; j <= i; j++) {
System.out.print("* ");
}
System.out.println();
}
}
}
Output:*
* *
* * *
* * * *
* * * * *
Program to draw Arc in Applet using fillArc() method in Java
Program to Find maximum number in Java
Program to use setPriority( ) method of Thread in Java
Conditional Operators Examples 2 in Java
Program to find HCF and LCM of two numbers in Java
Java Program for Converting Rupees into Paisa
Java program to check if a positive number is a palindrome or not
Order of exception subclass and superclass in Java
stringBuffer deleteCharAt() method in Java
subString() method example in Java
Program to explain Deadlock in Multithreading in Java Thread
stringBuffer append example in Java
Simple Inheritance Example in Java