Pattern programs in java part 2 : Learning made easy
Pattern programs in Java part 2: solved Java program for ICSE Class 9 Computer Applications with complete BlueJ code, explanation and sample output.
Pattern programs in java.
Click to learn more Patterns
Pattern 6
11111
1111
111
11
1
package Patterns;
class pattern8
{
public static void main()
{
for(int i=1;i<=5;i++)
{
for(int j=5;j>=i;j--)
{
System.out.print(1);
}
System.out.println();
}
}
}Pattern 7
***
***
***
***
***
package Patterns;
class pattern6
{
public static void main()
{
for(int i=1;i<=5;i++)
{
for(int j=1;j<=3;j++)
{
System.out.print("*");
}
System.out.println();
}
}
}Pattern 8
12345
2345
345
45
5
package Patterns;
class pattern10
{
public static void main()
{
for(int i=1;i<=5;i++)
{
int k=i;
for(int j=5;j>=i;j--)
{
System.out.print(k++);
}
System.out.println();
}
}
}Pattern 9
*
**
***
****
*****
****
***
**
*
package Patterns;
class pattern14
{
public static void main()
{
for(int i=1;i<=5;i++)
{
for(int j=1;j<=i;j++)
{
System.out.print("*");
}
System.out.println();
}
for(int a=1;a<=4;a++)
{
for(int b=4;b>=a;b--)
{
System.out.print("*");
}
System.out.println();
}
}
}Pattern 10
*****
****
***
**
*
package Patterns;
class pattern12
{
public static void main()
{
for(int i=1;i<=5;i++)
{
for(int j=5;j>=i;j--)
{
System.out.print("*");
}
System.out.println();
}
}
}Watch java videos
Related Posts
Continue learning with these related articles
Sum of First n Natural Numbers in Java (Loop and Formula)
Find the sum of the first n natural numbers in Java with a for loop, a while loop and the formula n(n + 1)/2, with a dry run and the sums of even numbers, odd numbers, squares and cubes.
Prime Number Program in Java: Check a Number and Print Primes in a Range
Check whether a number is prime in Java by counting its factors, a faster square-root method with isPrime(), and a program that prints all prime numbers in a range.

Encapsulation, Access Specifiers and Scope of Variables in Java for ICSE Class 10
ICSE Class 10 Computer Applications notes on encapsulation: private, default, protected and public access, data hiding with getter and setter methods, instance vs static (class) variables, local variables and scope, with a solved BankAccount program.