How to print the following pattern in java?

Ads
 

How to print the following pattern in java?

How to print the following pattern in java?

he he is he is going he is going in

View Answers

March 29, 2012 at 4:45 PM

import java.io.*; 
class StringPattern 
{ 
    public static void main(String[] args) throws IOException{ 

        String st="he is going in";
        String str[]=st.split(" ");

        for(byte i=0;i<str.length;i++) 
        { 
            System.out.println(); 

            for(byte j=0;j<=i;j++) 
                System.out.print(str[j]+" "); 
        } 
    }
}

Ads









Related Tutorials/Questions & Answers:
how to print the following pattern
How to print the following pattern in java?
Advertisements
how to print String as pattern ?
How to print the following output using c program
Java2
Print the following format
print the below pattern
print array in following format
print rectangle pattern in java
C program to print the following
Javah
how to make this pattern???
How to print this in java?
write a program in C to print following triangles on the screen
C Program to Print Following Output - Development process
i want print the following out put
ModuleNotFoundError: No module named 'javax'
ModuleNotFoundError: No module named 'javax'
how to get following output
how to get following output
Javah -  Header File Generator
Pattern
how to print the server time
pattern
How to print this Format exactly?
How to change the cloth pattern, change the cloth pattern, cloth pattern
how to print the server time
Javap Tool application
How to print UIButton id
Artifacts of javax
Pattern Making

Ads