Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

star pattern in java

    public static void main(String[] args) {
        for (int i = 0; i <10 ; i++) {
            for (int j = i; j <10 ; j++) {
                System.out.print(" * ");
            }
            System.out.println();
        }
    }

/*
*  *  *  *  *  *  *  * 
 *  *  *  *  *  *  * 
 *  *  *  *  *  * 
 *  *  *  *  * 
 *  *  *  * 
 *  *  * 
 *  * 
 * 
*/
Comment

print star pattern in java

public class Pattern   
{   
public static void main(String args[])   
{   
    
//outer loop for rows  
for(int i=5; i>=1; i--)   
{   
//inner loop for columns  
for(int j=1; j<=i; j++)   
{   
//prints stars   
System.out.print("*");   
}   
//throws the cursor in a new line after printing each line  
System.out.println();   
}   
}   
}  


Output:
*****
****
***
**
*
Comment

PREVIOUS NEXT
Code Example
Java :: android push notification icon 
Java :: how to increment character in java 
Java :: converting excel to csv in java 
Java :: java_home should point to a jdk not a jre 
Java :: optional throw if present 
Java :: java leap year expression 
Java :: selenide wait 
Java :: java get variable from another class 
Java :: indexoutofboundsexception java 
Java :: java guid 
Java :: javafx location is required 
Java :: boolean print condition java 
Java :: android toast message 
Java :: android check if app is running 
Java :: Diamond pattern program in java 
Java :: toast no android 
Java :: string remove last character 
Java :: find minimum number in array java 
Java :: java how to check string is number 
Java :: How to close jframe on click of button 
Java :: string to bigdecimal 
Java :: How to create a popup window (PopupWindow) in Android 
Java :: error cannot find symbol intent 
Java :: Java for Keyword 
Java :: java replace character in string 
Java :: overloading + operator in java 
Java :: print list array 
Java :: while loop java 
Java :: load file as string java 
Java :: double.parsedouble in java 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =