Skip to main content

Posts

Showing posts with the label butterfly pattern

Top Beginner Patterns in Java: How to Print Star, Number and Character (Lecture 6)

Java - Introduction to Programming Lecture 6 Patterns - Part 2 import java . util .*;   public class Solutions {     public static void main ( String args []) {         int n = 4 ;           //upper part         for ( int i = 1 ; i <= n ; i ++) {             for ( int j = 1 ; j <= i ; j ++) {                 System . out . print ( "*" );            }               int spaces = 2 * ( n - i );             for ( int j = 1 ; j <= spaces ; j ++) {                 System ....