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
difference between java5 and java6 - Java Beginners
Print the following format
print the below pattern
Java2
print rectangle pattern in java
print array in following format
C program to print the following
print the following series
Javah
how to make this pattern???
about java1
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
javaa swings - IDE Questions
i want print the following out put
how to get following output
how to get following output
how to print the server time
How to print UIButton id
About Java2
How to print this Format exactly?
how to print the server time
Javah -  Header File Generator
Pattern
how to print - Java Beginners
how to print pdf format

Ads