Java Program: Checkerboard Pattern of Asterisks

Question : (Checkerboard Pattern of Asterisks) Write an application that displays a checkerboard pattern, as follows:

* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *

Displays a Checkerboard Pattern of Asterisks in Java

/*
 *       Filename:  Checkerboard.java
 *
 *    Description:  2.27 - Write an application that displays a checkerboard
 *                  pattern.
 *
 *        @Author:  Bilal Tahir Khan Meo
 *        Website: https://www.codeblah.com
 *
 * =====================================================================================
 */

public class Checkerboard{
    public static void main(String[] args){
        for(int i=0; i<8; ++i){
            System.out.printf("%s* * * * * * * *\n", (i % 2 != 0 ? " " : ""));
        }
    }
}

Method 2 : Java Program: Checkerboard Pattern of Asterisks

/**
 *
 *	@Author:  Bilal Tahir Khan Meo
 *        Website: https://www.codeblah.com
 *
 * Exercise 2.27 - Checkerboard Pattern Of Asterisks
 *
 */
 
public class CheckerboardPatternOfAsterisks {
    public static void main (String [] args) {
         
        System.out.println ("This Application Displays A Checkerboard Pattern of "
                + "Astericks.");
         
        System.out.println ();
         
        System.out.print("********\n ********\n********\n ********\n"
                + "********\n ********\n********\n ********\n");
    }
}