Star printing program in Java, pattern 8 | Pattern program in java

 Star printing program in Java: pattern 8

A pattern program in Java is a program that uses loops and conditional statements to print a specific pattern or design on the console. These programs are often used to practice and improve programming skills and can range from simple patterns, such as triangles and stars, to more complex designs such as fractals and ASCII art. They can be implemented using basic programming concepts such as for loops, while loops, and if-else statements.

Star printing program in Java
 Star printing program in Java





Code for this pattern:


public class star {

    public static void main(String[] args) {
        int i, j, k;
        for(i=1;i<=5;i++)
        {
            for(j=i;j<5;j++)
            {
                System.out.print(" ");
            }
            for(k=1;k<(i*2);k++)
            {
                System.out.print("*");
            }
            System.out.print("\n");
        }
        for(i=4;i>=1;i--)
        {
            for(j=5;j>i;j--)
            {
                System.out.print(" ");
            }
            for(k=1;k<(i*2);k++)
            {
                System.out.print("*");
            }
            System.out.print("\n");
        }


    }

}

Try this in C.

Related post :

How to print Stars pattern in C                                 How to print Stars pattern in Java

Previous pattern                                                                                                         

14/Post a Comment/Comments

  1. Really an interesting post om star printing in Java.Continue sharing more like this.
    Regards,
    JAVA Training in Chennai | JAVA course in Chennai

    ReplyDelete
  2. Day by day I am getting new things and learn new concept through your blogs, I feel very confident, thanks for your informative blog keep your post as updated one...
    Regards,
    JAVA Training in Chennai|J2EE Training in Chennai

    ReplyDelete
  3. Thanks for taking time to share this webpage.It is really interesting to read.Continue shares more.
    Regards,
    C Training in Chennai | C++ training | C and C++ institute

    ReplyDelete
  4. Nowadays, most of the businesses rely on cloud based CRM tool to power their business process. They want to access the business from anywhere and anytime. In such scenarios, salesforce CRM will ensure massive advantage to the business owners.Cloud Computing Training in Chennai

    ReplyDelete
  5. Really Nice Blog. Thank you for Sharing. We are the best erp software providers in chennai. For more details call +91 9677025199 or email us on info@bravetechnologies.in
    ERP Providers Chennai | ERP in Chennai

    ReplyDelete
  6. Really nice post on Star printing program in Java.
    Java Training in Noida

    ReplyDelete
  7. Your article is really informative. Especially considering modern era of technology and world turning towards robotics, it will help many to learn from this article. Furthermore, if you want to have a look regarding communication technology you can visit the official site of VoIP Business and ca book your plan according to your need. To visit the site, clicke here.

    ReplyDelete
  8. Really awesome blog!!! I finally found great post here.I really enjoyed reading this article. Thanks for sharing your innovative ideas to our vision. your writing style is simply awesome with useful information. Very informative, Excellent work! I will get back here. . AWS Course in Chennai

    ReplyDelete
  9. Thanks for the informative article. This is one of the best resources I have found in quite some time.
    Nicely written and great info.I really cannot thank you enough for sharing.
    Reactjs Training in Chennai |
    Best Reactjs Training Institute in Chennai |
    Reactjs course in Chennai |

    ReplyDelete
  10. Thanks for sharing this wonderful article. Your article is very interesting to read. Explore the finest GCSE online tuition solutions with Ziyyara Edutech! Our expert tutors provide comprehensive support through interactive sessions, personalized learning plans, and exam-focused guidance.
    For more info visit GCSE online tuition

    ReplyDelete
  11. The information you have posted is very useful. The sites you have referred was good. Thanks for sharing. Ziyyara Edutech's expert tutors are dedicated to addressing difficulty grasping grammar rules, lack of conversational confidence, and challenges in comprehension.
    For more info visit Online classes for english

    ReplyDelete

Post a Comment