Pattern programs in java part 3: Learning made easy
Pattern programs in Java part 3: 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 11
*
* #
*#*
*#*#
*#*#*
package Patterns;
class pattern13
{
public static void main()
{
for(int i=1;i<=5;i++)
{
for(int j=1;j<=i;j++)
{
if(j%2!=0)
{
System.out.print("*");
}
else
{
System.out.print("#");
}
}
System.out.println();
}
}
}Pattern 12
*****
****
***
**
*
package Patterns;
class pattern11
{
public static void main()
{
for(int i=1;i<=5;i++)
{
for(int k=1;k<=(i-1);k++){
System.out.print(" ");
}
for(int j=5;j>=i;j--)
{
System.out.print("*");
}
System.out.println();
}
}
}Pattern 13
54321
4321
321
21
1
package Patterns;
class pattern15
{
public static void main()
{
for(int i=5;i>=1;i--)
{
int k=i;
for(int j=1;j<=i;j++)
{
System.out.print(k);
k--;
}
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.